How can work increase the temperature of a substance?
It is due to the Law of Conservation of Energy.
I have given an example below:
Heat is also a form of energy and since by the Law of Conservation or Energy, energy is always conserved, it implies that mechanical or electrical energy for example can be converted into internal heat energy, which results in increase in temperature since it causes particles to move faster, hence increasing their average kinetic energy by properties of particle model.
Suppose that an electric current of I amperes connected to a DC voltage source of V volts passes for a time t through a mass m of water at initial temperature
From the law of conservation of energy, energy lost by electric current equals energy gained by the water.