I am studying Portuguese too Amy, and had the some difficulties with this preposition. Maybe it could help you my experience of using EM, NO, NA: Whenever you do not need to use the definite article you should use EM. NO should be used in the case a masculine noun which asks for the definite article (em+o), e NA with feminine one. Bat please take care of the usage of NUM, (em+um) e NUMA, (em+uma), too.
So: Almoçei NUM restaurante. But, almoçei NO restaurante “Gato Preto”
Wish you all the best in your study.