Friction is the force that opposes the relative motion between two surfaces in contact with each other. It arises due to bumps and imperfections at the microscopic level between the two surfaces that cause them to stick together. There are two types of friction: static friction that acts before motion occurs, and kinetic friction that acts once motion has started. Friction is both helpful in many applications like walking and writing, but also causes inefficiencies in machines by converting useful energy into heat and causing wear and tear of moving parts over time. Engineers try to control friction through measures like changing surface roughness, adding grooves or spikes, or using lubricants.