Welcome to MADHOUSE!
So, Counterspelling ...
Counterspelling is a particular form of the Ready action, generally speaking. You choose a target (usually "that caster-looking guy over there"), and you ready an action to Counterspell him.
If, before your next turn, your target begins to cast a spell. You get an immediate Spellcraft check to identify it as it's being cast (DC of 15 + Spell Level). So, let's say you identify it. Each spell in the game has one or more specific counterspells: itself, and a spell with an opposite effect. For instance, slow and haste can be used to counterspell each other. The specific counterspells are always listed in a spell's description.
For purposes of argument, the opposing caster is casting a slow spell. Look over your spells memorized (or known, if you're a spontaneous caster). If you have any of the specific counterspells available, you choose which to cast (if you've got more than one) and the opponent's spell is ruined. In this case, you could counterspell with either a haste spell or a slow spell.
Alternatively, if you either didn't identify the spell or don't have the specific counterspell available, you may counterspell with Dispel Magic (or the Greater, etc., versions thereof). When doing so, however, there's a chance that the counterspell fails. You need to roll a caster level check (1d20 + Caster Level, maximum bonus determined by the Dispel you are using) against a DC of 11 + the opponent's caster level. If you beat this DC, the opponent's spell is ruined. If you fail, the opponent's spell works as normal.
[EDIT: There are feats which modify counterspelling, of course. Some of them let you try it once per round as a free action, others give you extra choices when it comes to specific counterspells, etc. See the individual feat descriptions for more info.]
Any questions?