Door Was
What do I do when the restroom door is locked in a restaurant?

I was in a restaurant last night and had to use the restroom. I tried the door but it was locked so I knocked but there was no response. I got down on my hands and knees to peer under the door where I saw two feet (there was obviously someone in there). I waited outside the door for another 10 minutes and then tried picking the lock to no avail. I ended up having to return to my seat, defeated. What should I do next time?

You picked the lock while someone was in there?? That's a little extreme... and dramatic to feel defeated while waiting for a toilet.
Some people just don't answer if you knock, but if you discover someone is in there just go back to your seat for a little bit and try again. If they for whatever reason had a separate bathroom you could find that out by asking anyone that works there. And if nobody was in it and they keep it locked you should ask for a key, very easy.