Pathfinder 2e
For Counteracting with spells, your Counteract check modifier is your spellcasting attribute modifier plus your spellcasting proficiency bonus plus any modifiers specifically to Counteracting. Roll this check against the DC of the effect (the effect's caster's DC, the affliction DC, etc). See the full rules here.