Gas connections. Install a 1/2 inch male flare adapter into the inlet opening of the heater's gas valve. Connect the gas flex-connector collar to the flare adapter (no dope or tape) and tighten with an adjustable open-end wrench. Everything okay, see that the thermostat is in the off position. Then you can turn the gas on.
Electrical connections. The wires serving an electric water heater must be the right size, providing the voltage and amperage the heater is designed for. Unless you know how to work with wiring, a qualified electrician should be hired to wire the heater. When you turn the heater circuit on, check the electric meter to see whether it is spinning, indicating that the heater is working.