The three prepositions “in, on and at” can be a little difficult to know when to use. We often use them with places and times.
For places, it’s easy to talk about something being “in a box”, “on a table” or someone working “at a desk”. But when talking about other places it can be tougher.
Remember that “In” is used for three dimensional places, things that have walls or borders.
For example: “She is in the house”, “He was born in China”, “I’m staying in New York”. New York has borders, even if you can’t see them. If it has walls, or a man-made border use “in”.
“On” is used for big things, where you are not surrounded by walls or man-made borders. Surfaces you can stand “on top of”, like streets, mountains, islands. We also use it for boats, since you can stand on top of the deck of a boat. Later on when other big vehicles like trains and planes were made we started using it for that too. “I get on a train” “I am on a plane” but “I’m in the car”.
“At” is tougher. We usually use it for where actions take place: “I’ll meet you at the park”, “He studied at Harvard”. You can also use it for abstract places “She isn’t at home”, but you can also drop it there: “She isn’t home”.
So what about things like: “I work in a hospital” and “I work at a hospital”. Both of those sentences are correct. The first one uses “in” and makes me think about a three dimensional building. The second one uses “at” and makes me think about the action of working.