As has already said the key is airspeed. To spin you have to stall and to stall you have to have a high AoA. Just keep an eye on your airspeed, make sure its what it needs to be. Also try and avoid uses of extra rudder when near the ground. Its all common sense really.
As for what to do if you spin, well the first thing I would do is try and recover. Its the only thing you can do. Depending on height and a/c you might be lucky, you might not. Altho I don't advise testing this at low level lol.