if your inbound and in the air ATC either slow you down, put you in a hold, and/or give you radar vectors to slow down the arrivals which they switch runways. If your inbound and on the ground usually your given a specific takeoff time (aka. wheels up time) by ATC, which if it's short (less than 45 min and delays due to the wind shifting are usually short, 5-15 min) and your still at the gate most crews opt to board and wait for the time to expire at the end of the runway. If it's long (more than 1 hour or so) most tend to hold off boarding until some time expires.
As for outbound the just have the aircraft on the ground taxi to the new runway they're using. It's suppose to be in order but I've done flights where we lucked out because we were at the end of the line and when they switched runway, since we were the closest to the new runway we got out before everyone else.