Water heaters are usually located on an outside wall where the cover is easily removed. The electrode/flame sensor is going to be located at one end of the gas tube. I think this is all easily accessed from outside.
I'm thinking the reason it lights for 5 seconds and then goes out is that the control board isn't getting a signal from the flame sensor. As a safety measure, the board is programmed to take that as meaning that gas is flowing, but hasn't ignited. If it allowed gas to continue to flow, you would soon have explosive conditions. So it shuts the gas valve off and tries again after a short delay. After 3 tries, the board is programmed to go into a safety lockout condition. To clear that and try again, you have to turn the switch off and back on.
It could be the electrode/sensor, or perhaps the control board is failing. The
electrode/sensor costs about $14. The
board is around $75.
If you want to test the sensor,
here's a video that shows how to test the sensor on a Suburban Furnace. The parts involved are similar, and in fact Suburban makes a replacement board that can be used either on Furnace or Water Heater.
I'd probably just spend the $14 on a new electrode/sensor and see if that fixes it.
Sorry, I haven't replaced one myself, but you might do a search for videos on how to do that.