The little help for me for advice how to use?

I have one simple question perhaps people could explain me…I would like to know how to use and in which situations I should use them correctly? so sometimes to me or for me mean same or to him and for him and so on . I confuse quite often when I need o use them I struggle with that. does someone can to answer.Perhaps the reason will be that I do not know all grammar rules:(

There are many variations, I’m afraid. Can you give me an example of a sentence where you get confused?