It takes time and practice to get the technique perfected.
If I am approaching a stop I will unclip as I am slowing down and take my foot off the pedal. I also raise up off the saddle so I can straddle the top tube when I stop and put my foot on the ground.
In an emergency I instinctively turn my heel outward and put my foot out beside the pedal so I'm as ready as I can be for the stop.
Practice, practice, practice.