You need to remember how the car acts under braking/ accelerating etc also what sort of setup the car has LSD etc etc,
For a FWD car to stop it spinning you need to do 1 of 2 things, Either get traction on the back or Correct the steering direction. Ideally both.
By hitting the brakes you take weight off the back and make it easier for it to spin round as you will be reducing any traction that is on the rear wheels also by braking hard you may lock the front wheels up this prevents you from steering stopping you from correcting the cars direction. The back end is moving in a different direction to the front if you stop the front the wheels acts like a pivot for the rest of the car to spin round.
The best way is stop it is to keep the power on (Dont just floor it though you need a some but not all the power) this will a keep the front wheels turning allowing you to steer and correct whilst keeping some weight on the rear wheels and helping it to get traction to the back. Remember power comes from the front and because of that the rear wheels are being dragged (rather than pushed if RWD) and you need to pull them into shape by accelerating. When correcting its easy to over correct and come spinning off in the other direction. Your actions need to be positive but not harsh.
With a RWD car things change, If the back end starts to go you need to come off the power Gradually. Sudden change in power Ie. Dipping the clutch or lifting right of the throttle or hitting the brakes are BAD and you will either continue to spin or more likely snap back in voliently and then it starts to spin in the other direction (Fishtailling). Again by adding more power you will only increase the spin speed and swing round more aggressively. In RWD the wheels are being pushed out of line and you need to stop pushing them in the wrong direction.
If you have a LSD (in either FWD or RWD) then the same things happen but to a lesser degree making controlling it a little easier.
For example I have a RWD Lotus Sunbeam, Very Powerful and very lively and with the LSD very controllable. When the Ass comes out in that, If I squeeze the throttle down (accelerate) it will come further and further out of line until it spins, If I snap off the power then it fishtails If I hold it where it is it will drive sideways and once everything is balance it will straighten itself out, But you dont always have the luxury of time to do this so you need to encourage it by gradually coming off the power and steering into the slide.