A method of using an aerosol-generating device (10) comprises the steps of, bringing a heating element (90) of the aerosol-generating device into contact with an aerosol-forming substrate (30), raising the temperature of the heating element (90) to a first temperature to heat the aerosol-forming substrate (30) sufficiently to form an aerosol, removing the heating element from contact with the aerosol-forming substrate and heating the heating element to a second temperature, higher than the first temperature, to thermally liberate organic materials adhered to or deposited on the heating element. An embodiment of an aerosol-generating device (10) comprises a heating element (90) coupled to a controller (19) for heating the heating element to the first temperature and to the second temperature.