A wiring diagram for hot water heaters can be found at Waterheatertimer.org. This website provides wiring diagrams for a variety of different water heater wiring settings. Many manufacturers such as General Electric make unit specific installation manuals available on the product's page of their website.
An installation manual includes all necessary wiring diagrams for the water heater. Some water heaters include wiring diagrams on the unit itself. Working with electricity is dangerous and improper wiring can destroy a water heater and injure or kill a person.
Many jurisdictions also require that an electrical permit be procured before installing or replacing a water heater and that the unit be inspected after installation. A licensed electrician can do this on your behalf.