Suppose you drag a piece of sandpaper along the surface of a wall (let's keep it simple). Here you are doing positive mechanical work on the sandpaper, this makes it gain energy. Friction does negative work on the sandpaper which makes it lose energy. Now, we know that because the sandpaper is in motion it gains some kinetic energy. But how does the sandpaper acquire heat, i.e., why does its temperature increase?

I've heard some people say it's the negative work of friction which makes the sandpaper lose energy, which ultimately transfers some of its thermal energy as *heat* to the environment. But if it loses thermal shouldn't its temperature actually decrease?
Or is it the other way around? Not *all* of the mechanical work gets transferred into kinetic energy. Rather some of it actually gets transported into the sandpaper as *heat*. But then again shouldn’t the negative work of friction make it lose some of that heat to the environment?

How does the temperature of the sandpaper increase when mechanical work is done on it?