Main thing with rattlesnakes is to just keep an eye out for them. They are rarely aggressive and usually just want to either get away or stay still and hope you don't see/attack them.
Know what to look out for -- snakes like to shelter under bushes or rocks, so don't put your hands or feet in/near those areas without making sure it's safe first. I recommend using a walking stick when hiking, and poke around with it.
Also, don't get so focused on something else that you forget to look down. Early one morning I went to check out the ruins of an old cabin. Walked right up to it, then happened to look down and see a coiled rattler literally 3 inches from my foot!
In the desert in hot weather, the snakes will often be active at night, so if you're taking a walk after dark, use a flashlight.