What is the purpose of the rudder on an aircraft?

Explanation:

The rudder is used to control the yaw of the aircraft, helping it maintain its direction by controlling the side-to-side motion of the tail.