Prepositions are a difficult part of each language I have studied.
There never seems to be a good rule.
I think each preposition must be learned through exposure and experience.
Other parts of grammar are easier to think about in an organized way, but prepositions seem to behave like individuals. Almost like idioms.
My point is, you can learn them and become good at them, but the best method is probably simply listening to a lot of English conversation over a long period of time.
Good luck!