Suppose you drag a piece of sandpaper along the surface of a wall(let's keep it simple). Here you are doing positive mechanic 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 bcz the sandpaper is in motion...