Move Priority

Priority Moves
+7 Pursuit (on a switch)
+6 Switching
+5 Helping Hand
+4 Magic Coat, Snatch
+3 Detect, Endure, Fake Out, Follow Me, Protect
+2 Feint
+1 Aqua Jet, Bide, Bullet Punch, ExtremeSpeed, Ice Shard, Mach Punch, Quick Attack, Shadow Sneak, Sucker Punch, Vacuum Wave
0 All moves not listed
-1 Vital Throw
-2 none
-3 Focus Punch
-4 Avalanche, Revenge
-5 Counter, Mirror Coat
-6 Roar, Whirlwind
-7 Trick Room

A faster Pokemon always goes first within the speed bracket of the move. In every single case, higher priority moves go before lower priority moves.

The 'exceptions' are Assist, Me First, Metronome, Mirror Move, and Sleep Talk. These have a priority of 0, and thus if you Sleep Talk Whirlwind, for example, you can go before a slower Pokemon using, say, Tackle.

In DPP, the faster phazer uses Roar / Whirlwind, sending the enemy away, thus giving them no chance to try and Roar / Whirlwind you.

Revenge and Avalanche get boosted damage from Focus Punch, and do not interrupt it, making them the only attacks that cannot interrupt Focus Punch.

Quick Claw gives your Pokemon a 20% chance of ignoring Speed and going first within your speed bracket, barring the enemy also activating a Quick Claw, in which case normal Speed rules would apply. Speed and Quick Claw never let a move with a lower priority beat a higher priority (so a Quick Claw activated Deoxys-S using Counter always goes after Macho Brace paralyzed Shuckle using Wrap). Custap Berry makes your next move automatically go to the top of its priority bracket after activating.

Full Incense, Lagging Tail, and the ability Stall make that Pokemon always move last, if both Pokemon are using a move of the same priority. Lower priority moves will still always go after higher priority moves, regardless of Full Incense, Lagging Tail, and Stall. If two Pokemon with Stall are out at the same time, the one with higher Speed goes last. If two Pokemon are holding Full Incense or Lagging Tail at the same time, the one with the higher Speed goes last. If a Pokemon with Full Incense / Lagging Tail is out against a Pokemon with Stall, the one with Full Incense / Lagging Tail goes last. If a Pokemon with Stall activates Quick Claw, the that Pokemon will still go first, barring a faster Pokemon activating its Quick Claw.

Trick Room reverses the use order of the moves in the same priority. For instance, if a Pokemon with 3 Speed is up against a Pokemon with 10 Speed, the one with 10 Speed would normally go first, but under Trick Room, the one with 3 Speed goes first. Higher priority will still beat lower priority, however. Pokemon with Full Incense, Lagging Tail, and Stall completely ignore Trick Room, so they go last in the order explained above. Pokemon with Quick Claw completely ignore Trick Room as well, so Quick Claw still makes you go first, and if two Pokemon activate their Quick Claw, the faster Pokemon still goes first.

Pursuit comes right before a switch if a switch is used. It doubles in power if they switch out. If they use Baton Pass and you are faster, the Pokemon using Baton Pass takes normal damage. If they use Baton Pass and you are slower, the Pokemon they pass to takes normal damage. If they use U-turn and you would normally go before them, the Pokemon using U-turn takes normal damage. If they use U-turn and you would normally go after them, the Pokemon using U-turn takes double damage, and then they select the Pokemon to bring out, which takes no damage, so essentially, if you use Pursuit and they use U-turn and you would normally go after them, Pursuit has 0.5 priority (so in Trick Room, you would have to be faster than them to get the boost, unless their Quick Claw activates or you are holding Full Incense / Lagging Tail or have the ability Stall).

Focus Punch's charge message comes at the very beginning, before even switching.