I have a home gym, so don't have this issue. But if I couldn't get my workout in because of time constraints, I'd honestly just shift my days around."Welp, today is gonna be a cardio day, I'll lift tomorrow"
Those exercises are too important to me to skip so here's what I do
Survey the landscape and try to figure out who might be finished the soonest. If someone is warming up, probably not them
Ask how many sets they have left
If they have less than two, ask if I can have the rack next
If more than two, ask someone else
After doing this, find a spot in eye shot of the rack but not like right next to them staring them down
Do some warm ups - if squats I'll do goblet squats or just squats holding a 25lb plate. If bench I'll warm up with light dumbbell bench or pushups, etce