People who have some plumbing skills can replace a gas valve on their own homes without consulting a professional. However, those with no experience would likely benefit from calling in a plumber, as gas leaks are not something to take lightly.
Changing a gas valve starts with turning off all power to any units the gas valve feeds, such as a hot water heater or furnace. Next comes removing the wires from the valve. If there are more than two, it's important to mark where they go into the valve for the installation of the replacement, but if there are only two, it doesn't matter where they connect to the new valve. After turning the gas off, it's time to replace the valve. Pipe dope helps to make all tapered fittings airtight after the replacement.