Agree, if it had a leak, replace it. Not worth the money or hassle.
A bad thermocouple will still allow gas to flow when the pilot/on/off switch is in the pilot position and pressed.
And no it doesnt have any wires on it. It is a small copper tube with a fitting made of aluminum or similar on one end and the "sensor" on the other. If you want to start here be sure to check the threads on the old ones. Some go in clockwise, others counterclockwise.
But im thinking this isnt the case anyway. It SHOULD light anyway, but just go out after you release the pilot button. Not the case with your heater.
Depending on the age of the unit, it may have a "flame roll-out" switch. This is a heat sensitive "breaker" type switch mounted USUALLY near the pilot access door. It has two wires leading to it. One on each side. If this thing goes, your heater wont fire at all...not even the pilot (again gas will still flow when the pilot button is pressed.)
Gas valves themselves go extremely rarely. Again the pilot would at least light. In addition, more often than not gas valves will just leak but still
function.
Anyway, like somone else mention if the unit is older than 8 years and has leaked, just get a new one.
BTW change your anode rode every two years, or year and a half with a water softener. Just need some pipe dope (NOT TEFLON TAPE) and usualy an 1" 1/16" socket and ratchet. Shut the supply to the tank off, drain a couple gallons out of the drain at the bottom (NOT THE T&P DROP) and spin the old one out, install the new. Done.
you DO have the gas valve knob (where you set the temperature not the knob on the top) set to "pilot" when you are trying to light the thing right?