Hot water heater

My Whirlpool gas water heater was installed 2-3 years ago and is not maintaining the temperature of the water. The water is often room temperature or cooler. The temperature knob has been dialed to its highest temperature. When the pilot is turned off, and re-lit 30 minutes or so later, the water will remain relatively hot for the next hour or two.

According to the manufacturer, due to the existing (improper for this unit) side venting, the wind is pushing back into the unit and that is affecting the tanks ability to heat, or keep the water heated.

I’d like to get another two-three years out of my current tank. Does anyone have any insight or suggestions as to what part could be replaced to get this part working again and if its replaceable? I’d like to get another 2-3 out of my current tank before I have convert to tank-less.

Thank you.

The thermostat is bad and needs to be replaced.