To flush out a water heater you hook a standard garden host to the water heater drain spigot and then open the spigot.
After opening the drain spigot on the water heater you should open up the pressure relief valve to relieve the air trapped in the water heater.
Opening the pressure relief valve will also help the water heater drain faster.
You should also turn off the hot water valve and once the water heater has drained down you should turn the cold water valve back on and let it run for about 30 minutes to help force any sediment build up out of your water heater.
Once all that is done you just reverse the process by turning off the drain spigot, removing the hose, closing the relief valve and then make sure you have the cold water turned back on and then turn the hot water side back on as well.
One more thing before you drain the water heater especially if it's electric water heater is to turn the water heater off so the heating elements won't burn out when there's no water in the water heater.