There are over 100 prepositions in English.
Here is a list of common prepositions:
above, about, across, against, along, among, around, at, before, behind, below, beneath, beside, between, beyond, by, down, during, except, for, from, in, inside, into, like, near, of, off, on, since, to, toward, through, under, until, up, upon, with and within.
Even advanced learners of English find prepositions difficult, there are hardly any rules as to when to use which preposition. The only way to learn prepositions is by looking them up in a dictionary, reading a lot in English and learning useful phrases off by heart.
Students who are learning English often tell me how difficult it is for them to learn prepositions. They ask questions such as ‘Am I in a restaurant or at a restaurant?“, but I have to tell them that both are OK.
In some circumstances the phrases can have different meanings.
For example, if you are waiting for someone outside a restaurant, you are at the restaurant, not in the restaurant; but if you are inside, you can be both in or at the restaurant.
We commonly use prepositions to show a relationship in space or time or a logical relationship between two or more people, places or things. Prepositions are most commonly followed by a noun phrase or pronoun.
The last time I saw him he was waiting for the bus. I’ll meet you in the cafe opposite the station. It was difficult to sleep during the train journey. It was the worst storm since the 1990s. Give that to me. Two of the guests are vegetarian. It is of no consequence.
British English versus American English
People speaking British English sometimes use different prepositions from people speaking American English too. In the US, they might say: something is different from (the standard) something else, or perhaps that something is different than something else (less acceptable, but still common), but in Britain, you might also hear that: something is different to something else, which sounds very odd to American ears. In US English, they would say Bloomingdales is on 59th Street, but in Britain, they’d say Harrods is in Brompton Road.
If you aren’t sure whether you should write ‘We were in the restaurant,’ or ‘We were at the restaurant,’ you can search for those phrases using Google Books Ngram Viewer and see that although both are in use, ‘in the restaurant’ is a bit more common.