The default hierarchy
Right of way is a hierarchy. Pedestrians in any crosswalk, marked or unmarked, have the right of way over vehicles. Emergency vehicles with lights and siren have the right of way over everyone else. Trains have the right of way over road traffic at uncontrolled crossings. Among ordinary vehicles, the rules cascade: traffic already in the intersection, traffic on the through road, traffic from the right at a four-way stop, traffic going straight before turning traffic.
When two cars arrive together
At a four-way stop, when two cars arrive simultaneously, the driver on the right has the right of way. When three cars arrive simultaneously, the same rule applies — the rightmost goes first, then the next, then the last. When you and an oncoming car both want to turn, the car going straight (if there is one) has priority over both turning cars.
Roundabouts and merges
At a roundabout, vehicles already in the circle have the right of way. Look left, wait for a gap, then enter. On a freeway on-ramp, vehicles already on the freeway have the right of way; you must use the acceleration lane to match traffic speed and merge into a gap, not force your way in.
School buses and emergency vehicles
Two right-of-way scenarios show up on nearly every test: school buses with flashing red lights and emergency vehicles with sirens. For school buses on undivided roads, both directions stop. For emergency vehicles, pull as far right as safe and stop until the vehicle passes. Both rules exist because the cost of getting them wrong is too high to leave to judgment.