Energy harvesting is a modern concept which makes dissipated heat useful by transferring thermal energy to other excitations. Most of the existing principles for energy harvesting are realized in systems which are heated continuously, for example generating DC voltage in thermoelectric devices. Here we present the concept of high-frequency energy harvesting where the dissipated heat in a sample excites resonant magnons in a 5-nm thick ferromagnetic metal layer. The sample is excited by femtosecond laser pulses with a repetition rate of 10 GHz which results in temperature modulation at the same frequency with amplitude ~0.1 K. The alternating temperature excites magnons in the ferromagnetic nanolayer which are detected by measuring the net magnetization precession. When the magnon frequency is brought onto resonance with the optical excitation, a 12-fold increase of the amplitude of precession indicates efficient resonant heat transfer from the lattice to coherent magnons. The demonstrated principle may be used for energy harvesting in various nanodevices operating at GHz and sub-THz frequency ranges.