Two objects in thermal equilibrium with each other are at the same temperature . You can add thermal energy to an object by doing work on the object. If you rub an object, the force of sliding friction does work, and changes ordered kinetic energy into thermal energy. If fuel burns, chemical energy is converted into thermal energy. Atoms in molecules and solids are held together by chemical bonds.
Chemical bonds are electromagnetic in origin, but can be modeled well by tiny springs.
Two atoms held together by a spring have an equilibrium position. If they are pushed closer together, they repel each other. If they are pulled farther apart, they attract each other. If they are displaced in any way from their equilibrium position and then released, they start vibrating about their equilibrium position. An atom can form different chemical bonds with a variety of other atoms.