A filthy flame sensor and a dirty air filter are two of the most common reasons your home's central heating isn't working. Replace the air filter every 1-2 months and clean the flame sensor with a steel wool pad.
This will indeed prevent the problem. However, even after cleaning your heating system is not working correctly, you must call a professional to fix the problem.