please explain the following adjective prepositions with their right context and their meaning. I could not understand their usage. I would be very greateful if it explained properly.

1. He was very good to us when we were in trouble

2. She is good at learing languages

3. It was good for you to write to them

4. He was a horrible man, I could not see any good against him.
1) OK. If you are "good to" someone then it means you are kind towards them and treat them well.

2) OK. If you are "good at" something then it means you are skillful at it and can do it easily or well.

3) This is possible, but "good of you" seems more likely. If something is "good for you" then it is beneficial to your health or wellbeing. For example: "Exercise is good for you". "good of you" is something you say to someone when they did something generous, kind or helpful. For example: "It was good of you to help me with my homework".

4) Doesn't seem right. You probably mean "I could not see any good in him". This means you cannot identify any part of his character that is good (in the sense of decent, generous or kind). He is all bad.
Excellent explanations, I am very greateful to you sir