The easiest way is to create a linearised sorting value. The lap count is the major sorting value so the current waypoint doesn’t matter if the lap count differs. Only when the lap count is the same you need to differentiate by the waypoint.
A common way is to simply muliply the lap count by the number of waypoints and add the current waypoint index (assuming counting starts at 0). This way you get a continuous value For example if you have 24 waypoints it would look like this:
// unsorted
[0] car: 1, currLap = 4, currWaypoint = 12, position = 108 (==4*24 + 12)
[1] car: 2, currLap = 4, currWaypoint = 2, position = 98 (==4*24 + 2)
[2] car: 3, currLap = 2, currWaypoint = 12, position = 60 (==2*24 + 12)
[3] car: 4, currLap = 6, currWaypoint = 5, position = 149 (==6*24 + 5)
// sorted
[0] car: 4, currLap = 6, currWaypoint = 5, position = 149 (==6*24 + 5)
[1] car: 1, currLap = 4, currWaypoint = 12, position = 108 (==4*24 + 12)
[2] car: 2, currLap = 4, currWaypoint = 2, position = 98 (==4*24 + 2)
[3] car: 3, currLap = 2, currWaypoint = 12, position = 60 (==2*24 + 12)
Instead of the number of waypoints you could also use an arbitrary multiplier as long as it’s large enough (100 or 1000 for example). You can simply sort the list based on the “position”. This position can be calculated on the fly. For example if you have a List<Car> cars you can simply do:
cars.Sort((a,b)=>(a.lap*1000+a.currentWayoint).CompareTo(b.lap*1000+b.currentWayoint));
A bit cleaner would be to implement a property / getter for the position in your car class and / or let your Car class implement the IComparable interface.