Ahhh prepositions. They are one of the most challenging aspects of learning English because there aren’t too many rules to them (though learning prepositions of location/place are relatively easy). You mostly just have to remember which preposition goes with which expression, verb, or phrase. This can be done by reading, listening, and good old-fashioned studying/review.
Luckily, here is a great list of common prepositions along with when they are often used: Preposition List
Once you have reviewed a bit, try out your new knowledge here with this: Preposition Quiz
Good luck and be patient. It will take time to master the art of the preposition!