First decide whether you are splitting or circling
With two swimmers, some pools allow the lane to be split so each person keeps one side. Elsewhere, circle swimming is standard even with two people. With more swimmers, a circle is usually the practical solution.
Do not assume your usual system is universal. Confirm it at the wall and follow posted rules or lifeguard instructions. An imperfect convention shared by everyone is better than two different conventions in the same lane.
Leave real space when you start
Leaving directly on another swimmer's feet does not improve your place in line. You spend the length in their turbulence and are more likely to catch them at the wrong moment. Many organized groups use about five seconds between swimmers, but the useful gap depends on the lane and the set.
If a faster swimmer is reaching the wall just as you are about to leave, let them come through first. Waiting two seconds can prevent fifty metres of frustration.
Passing starts with a signal, not a fight
In groups that use the convention, a light tap on the feet can signal that a swimmer wants to pass. The swimmer ahead can then make room at the wall. Local practice and experience matter, though: if the signal is unfamiliar, talk at the wall instead of forcing a pass.
Avoid squeezing past when another swimmer is approaching in the opposite direction during circle swimming. The wall is often the safest place to reorganize the order.
Information
Finish the repeat without blocking the T
When you finish, move to the side of the wall. The centre of the lane and the T marking are useful to swimmers arriving to turn or finish. A group that keeps that space open can be surprisingly large without creating a traffic jam at every send-off.
The right order can change with the set
The fastest freestyler is not necessarily fastest at breaststroke or kicking. Before a new block, changing the order can be easier than creating repeated passes.
This is not a permanent hierarchy. The order only exists to keep reasonable spacing during the set you are doing now.
Useful courtesy is mostly predictability
Stay on the expected side, do not push off in front of someone arriving fast, make room at the wall, and tell the lane when the pattern changes. These small habits let everyone focus on swimming.
Sharing a lane does not require everyone to have the same ability. It mostly requires each swimmer to be able to predict what the others will do over the next few seconds.