Consider gravity; you throw a ball straight up, and it leaves your hand with a certain amount of kinetic energy. At the top of its path, it has no kinetic energy, but it has a potential energy equal to the kinetic energy it had when it left your hand. When you catch it again it will have the same kinetic energy as it had when it left your hand. All along the path, the sum of the kinetic and potential energy is a constant, and the kinetic energy at the end, when the ball is back at its starting point, is the same as the kinetic energy at the start, so gravity is a conservative force.
Friction, on the other hand, is a non-conservative force, because it acts to reduce the mechanical energy in a system. Note that non-conservative forces do not always reduce the mechanical energy; a non-conservative force changes the mechanical energy, so a force that increases the total mechanical energy, like the force provided by a motor or engine, is also a non-conservative force.