Thermal energy is the sum of the kinetic energy of the particles and the potential energy of the particles in an object. Therefore,
if kinetic energy increases, thermal energy increases
if potential energy increases, thermal energy increases
If either potential or kinetic decrease, thermal decreases.
Hope this helps!