How do I program a four wheel drive?

If you are using VexCode, here is an excellent explanation. It covers drive trains with 4 motors and also drives with and without gyroscopes.

I did not make this all credit to @jpearman