If you look up your heater model online at the Hayward website, you can likely find a copy of the user manual. The user manual usually has a diagnostic procedure in it for various types of failures. Most gas heaters have a thermistor that reads the intake temperature of the water. Thermistors can and do go bad with age where they no longer accurately change resistance with temperature. Your fix may be as simple as just changing out a thermistor. Also, even if the heater is no longer under warranty, you can still call Hayward’s technical support line and they'll usually give you a few things you can try to do. Once you narrow it down to what the likely problem is, you can figure out if it’s something you can fix yourself or call in a professional for.
A heater that size is going to cost $2500-$3500 to buy new install (subject to local pricing). So it may be worth a little time and effort to see if there’s a cheap fix.