At sea, the rules of priority are governed by the RIPAM (Règlement International Pour Prévenir les Abordages en Mer - International Regulations for Preventing Collisions at Sea). These regulations grant rights and confer obligations with which everyone must comply. In the event of a collision, the rules establish which of the two boats must maneuver to avoid a collision.

It's also worth remembering that the priority vessel must do everything in its power to prevent a collision if the other vessel fails to do so. In all circumstances, let's show good seamanship and courtesy: the priority boat may well choose to change course if the maneuver is easier.

The collision course
A risk of collision between 2 boats is also called a collision course. This risk is assessed using a compass bearing. The collision course is confirmed if the compass bearing of the approaching vessel does not change significantly.
Constant bearings

The 4 fundamental priority rules
The following 4 rules are a kind of framework for quickly determining the distribution of priorities. As soon as the priority is established, the flow of the canvas ends.
Don't forget that you must have the RIPAM on board. It's a complete set of regulations that you need to study and know to sail safely.
1 - A sailboat has priority over a motorboat
RIPAM gives sailboats priority over motorboats, whether dinghy or tanker-sized.

Note that this priority is lost when facing a motor vessel with restricted manoeuvring capacity (such as a tugboat in action, for example). Or in a traffic separation zone (DST). Or a fishing vessel in fishing action.
Use your seamanship and treat this priority with caution. Don't underestimate the maneuvering time of a motor vessel: a tanker travelling at 20 knots takes several minutes to correct its course. And don't assume that anyone on the bridge or on radar has seen you.

2 - A vessel overtaking another must avoid collision by moving out of the way

Rule 13 applies. Whether it's a sailboat or a motorboat sailing faster than another, it's always the faster boat that must perform the evasive maneuver.
If you're the overtaking vessel, make sure you're far enough away so as not to disturb the slower boat. All the more so if it's a small sailboat travelling at 5 knots, overtaken by a motorboat travelling at 20 knots. Good manners at sea.
3 - A sailboat on starboard tack has priority over a sailboat on port tack
This is the famous RIPAM rule 12. When two yachts are on a collision course, the best thing to do is to determine the tack at which each boat is sailing.
In other words, to define from which sides the sailboats receive the wind.
Sailing on starboard tack - with the wind coming from starboard - the sailboat has priority. Sailing on the port side, the ship on the tack must maneuver to avoid collision.

A yacht sailing on port tack will therefore spend its time checking that it is not on a collision course with another yacht.
It's a rule that makes sailors say that a sailboat on starboard tack is king of the seas. This does not exclude regularly checking to leeward that no boat is on a collision course.
4 - Even on a tack, the leeward yacht has priority
Rule 12 still applies. Remember this rule well, as it often comes in handy (especially with motorboats).
When 2 yachts are sailing on the same tack, port or starboard, the leeward yacht - the one on the closest course to the wind - has priority. The other yacht will have to luff away, pass behind or tack.

Please note that the spinnaker does not grant any rights
A sailboat under spinnaker is not considered to be in restricted maneuvering capacity by the RIPAM. It must therefore comply with the rules and, if necessary, lower the spinnaker to avoid a collision. Once again, let's show courtesy and common sense by giving way, if possible, to the brave crews sailing under spinnaker.