A standard airport traffic pattern turns left unless the airport indicates otherwise. The AIM, Chapter 4, Section 3, and AC 90-66 describe that left-hand pattern, and a published right-hand pattern is the case where the airport has indicated otherwise. After takeoff, an airplane that stays in the pattern to land flies upwind, then crosswind, then downwind, then base, then final.
The rule
The Pilot-Controller Glossary and AIM 4-3 name the legs in that order. Upwind is the climb straight out on the runway heading. Crosswind is the first 90-degree turn. Downwind is the leg parallel to the runway, flown opposite the landing direction. Base is the descending 90-degree turn toward the runway. Final is the leg aligned with the runway for landing. Scrambling the middle legs is the usual memory error: crosswind does not come after downwind, and upwind is not the last leg before final.
Turns in that rectangle are to the left unless right traffic is indicated. They do not alternate left and right on each leg. They are not aimed at the windsock. The windsock tells you which runway is favored. The pattern side is a separate marking, covered with the sock on the windsock page and with the numbers on runway numbers.
You also need the reciprocal end, because traffic calls name both directions of the same pavement. Opposite runway ends differ by 18. That 18 is 180 degrees divided by 10, which is how runway numbers are built. The reciprocal of Runway 4 is Runway 22, about 220 degrees magnetic. An airplane on a straight-in to Runway 4 is aligned roughly northeast. An airplane departing the opposite end is using Runway 22 and climbing out toward about 220 degrees. Runway 40 is not a reciprocal, and Runway 14 is not the opposite of Runway 4. Using 18 itself as the runway number is the arithmetic trap.
Section 107.43 prohibits interfering with operations and traffic patterns at any airport, heliport, or seaplane base. Knowing the leg order tells you where the airplane will be low. How to yield when you are already in the air is on operating near airports.
How to apply it
Stand where you can see the runway in use and sketch the rectangle. If nothing indicates right traffic, draw the turns to the left of the landing direction. The airplane that just lifted off is on upwind, climbing away from you if you are at the approach end. Its first turn is crosswind. The leg that comes back toward the approach end, parallel to the pavement, is downwind. The turn off downwind is base. The last alignment is final, which is where the airplane is lowest over the ground short of the runway.
When you hear two calls on the CTAF, tie them to the numbers. A straight-in approach to Runway 4 uses one end. A departure from the opposite end of that same strip is Runway 22, climbing toward about 220 degrees. Your aircraft should not be parked in either of those paths. Left traffic and a reciprocal departure can be in the air at the same time.
One airplane, five legs, two runway numbers
A light airplane takes off and stays in the pattern to land again. Call the legs as it flies them: upwind on the climb, crosswind after the first 90-degree turn, downwind parallel and opposite the landing direction, base on the descending turn, final aligned with the runway. If you recite crosswind first, or downwind first, you have rotated the rectangle.
While you listen, another airplane reports a straight-in approach to Runway 4. A third airplane departs from the opposite end of the same pavement. That departure is Runway 22, climbing toward about 220 degrees. You keep the small unmanned aircraft clear of final for Runway 4 and clear of the upwind climb for Runway 22. The pattern turns stay left unless this airport has indicated right traffic for one of those runways.
The trap
The turn item offers alternating left and right, or turns toward the windsock. The standard is left unless the airport indicates otherwise. Right traffic is the published exception, and it is the common trap when a question asks for the standard.
The leg item offers "crosswind, upwind, base, downwind, final" and "downwind, base, crosswind, upwind, final." The order after takeoff is upwind, crosswind, downwind, base, final. The reciprocal item offers Runway 40 toward 400 degrees, which is not a heading, and Runway 14 toward 140 degrees, which is not 18 away from Runway 4. Runway 18 as an answer would be the trap of using the difference itself as the runway designator. The opposite of Runway 4 is Runway 22.
Practice the rectangle and the reciprocal on the free practice test. The course draws the five legs in the order the airplane actually flies them.