Put the transmission to neutral and park on the side of the road when it happens. If it gets locked up when you’re parked, don’t try to start the car as you can burn out the starter and create more problems.