A preposition is a word that links a noun, pronoun, or noun phrase to some other part of the sentence.
There is no definite rule or formula for choosing a preposition so its up to you to identify the right one and how it is used.
A preposition is used to show direction, location, or time, or to introduce an object.
On
Used when expressing a surface of something
(Place it on the table)
Used when expressing dates and days
(I was born on the 14th day of July)
Used to indicate a device or machine
(The comedy show on the television is not so funny.)
Used to indicate a part of the body
(The ball hit him on the head)
Used when expressing the state of something
(The house is on fire!!)
At
Used to express specific time
(I will meet you at 3 p.m)
Used when indicating a place
(There were many people at the party)
In
Used to indicate a location or place:
(My house is located in the middle of town.)
Used to indicate a shape, color, or size:
(The cars moved around in a straight line.)
Used when expressing a belief, opinion, interest, or feeling
(I believe in you.)
Used for unspecific times during a day, month, season, year
(She eats her lunch late in the afternoon)