How can I prevent hives?

Antihistamines. If you're particularly allergic to something, let's say a cat - and you know you'll be coming into contact with one tonight or tomorrow, you can premedicate with over the counter antihistamines like zyrtek, Claritin and allegra. Benadryl (diphenhydramine) works better but can also make you sleepy.
Hives. There really is no way to prevent hives. If you already have them then you need to discover if there is something causing them that can be eliminated and/or getting a doctor to control the hives until they burn out. An allergist is best at treating hives.