How am I supposed to tell if they mean "the restaurant" or "a restaurant?
"im" is "in the", (in+dem). So in this case im is "in THE restaurant". If it was "a restaurant" they should say "in einem Restaurant".
"a" restaurant is usually when in German they say "one".
But in general I have no idea. Neither German nor English are my native tongs.
In big shortcut:
der, die, das - the
ein, eine, einen etc - a
"Im" = "In + dem", aka "in the". If you've know any spanish, it is similar to "del".
This seems like a pretty advanced distinction to make at this stage ("im" = "in the" vs. "im" != "in a"). I don't think we covered this until at least the second semester of German in college.