A pilot is the smallest flame in the house, in the coldest space, and the diagnostic order below reflects that.
1. Draught
Vents, a loose door, an outbuilding with gaps. Cold air moves the flame off the thermocouple and the valve closes. Check the flame's shape before anything is unscrewed: a lifting or wandering flame is telling you about air, not parts.
2. The thermocouple
It generates the small current that holds the valve open. Measured in millivolts, it is either in specification or it is not — and marginal ones fail as they cool, which is exactly the overnight pattern.
3. Fuel
On propane, tank level and regulator. On piped gas, an interruption or a partly closed valve.
4. Altitude and jetting
Correct rating for the elevation, correct orifice for the fuel. Wrong jetting gives a rich, unstable or sooty flame.
5. The valve
Last.
The vent question
On the hill the vent has two jobs beyond draft: clearing the snow line, and screening embers in a forested high-fire area. Both are installation decisions, and both are cheaper to correct at the same visit than in a later emergency.
Safety boundaries
A gas smell means leave the building and call the supplier or emergency services. Soot, scorching or exhaust spillage are reasons to stop using the appliance.
Replace or repair
A thermocouple on a sound tank is a straightforward repair. On an older unit, a new heater also gets the venting right, which is often the point.
What to have ready
Fuel, tank level, failure timing, location.