There should be 2 pipes attached on the top (in most cases) of the water heater. They will be labeled hot and cold or, have red and blue markings. Follow the cold or, blue back to the valve and turn it off. Next you need to turn off the water heater. Down low on the side there is a gas valve turn it to the off position.
You probably will need a plumber to replace it if the tank is leaking.
I would recommend replacing it with a Bradford-White Water Heater.
Whatever you do avoid Whirlpool and A.O. Smith.