It depends on my situation. In a casual encounter, I might just glance around looking for the guy, and perhaps ask "Who are you talking to?" if nobody is around.
Sometimes with someone I know who accidentally misgenders me, I might bend over to look at the crotch on my skinny jeans, then stare at the person for a second. I also might put on one of the "SHE/HER/HERS" buttons I carry with me in my bag.
If it's a more persistent misgenderer, such as a clerk or waiter that keeps up with the "Sir", "Sir", "Sir" nonsense I will call them directly on it and shove my ID in their face and ask for their manager. No tip for the waiter, of course, and I leave a little note on the receipt to let them know exactly why. "Great service, except the waiter kept calling me Sir!" I also leave online negative feedback.
On the street, someone soliciting who misgenders me gets ignored.