In this video by Pros DIY, a journeyman goes through the process of troubleshooting your water heater. One of the common reasons your water heater is not functioning right is due to a pilot light malfunction.
The pilot light ignites the gas when the temperature drops below a certain point. Sometimes the pilot light tube can get clogged, meaning you need a hot water heater repair service to replace it.
If the water coming out of your faucet is rusty, then you could have a corroded anode on your hands.
The anode can be replaced, but you may need to replace the tank if the rust is extensive. Discolored water without a red hue can be caused by a buildup of heavy minerals, so flushing the heater might work.
Flushing will also help kill any bacteria that could cause foul odors. Other issues include faulty valves or leaks, which need to be reported to the gas utility company after ventilating the room and turning off the heater. Last but not least, make sure you paid for gas.