I didn't have hot water last night. Checking the water heater, the LED on the front wasn't blinking which meant it either wasn't receiving power or the pilot light was out. It's an AO Smith with a Honeywell control unit on the front as in only about 5 years old.
No breakers were tripped, so I was confident it at least had power, though it's a bit annoying that there's no obvious light on the box to demonstrate it actually does have power. I followed the procedure for relighting the pilot light several times and LED would not start blinking normally. My stupid water heater is behind a door in a tiny room in my garage with my furnace / HVAC stuff. Because of the cramped space, I could not actually look through the small window at the bottom of the water heater to see if the pilot light was even sparking.
So I found a small mirror and set it up to get a view inside the window. After turning off the garage lights and some awkward positioning, I was finally able to see the tiny flame when following the lighting procedure. So at least that was working. But the pilot light would never seem to catch to make the system operate normally. The flame would go out immediately after releasing the pilot button.
Watched a bunch of youtube videos and returned to the task this morning. Possibly an air flow problem or ignitor safety reset. Safety reset thing wasn't tripped so I tried to clean all the filters and retried the procedure. Same outcome as last night with the initial flame from the ignitor but no normal operation. I was about to give up and call a plumber, but decided to watch one more youtube video, which demonstrated measuring the voltage from the wires at the front of the unit to test for a defective something or other.
Found my voltmeter and detached the small connector on the front of the control box to measure the voltage. The voltage went up past 350 mV as expected. So at least that part wasn't defective. Though that meant I had no more ideas, so again was about to call a plumber, but plugged the connector back in and gave the procedure one more go, and it TURNED ON!
I have no idea why, maybe there was some sort of reset that needed to occur that happened when I disconnected that small connector. Took like 3 hours of troubleshooting. We'll see if it stays on.
That'd be the thermocouple. I haven't replaced one in a recent water heater, but have done them in gas stoves and furnaces without too much fuss. OP said their water heater is in a cramped space, so may be better for them to just plan to replace it since they'd probably need to disconnect it to be able to work on it at all. Replaced mine in February for about $650 including delivery and new fittings.