Prepositions "for" or "to" in direct and indirect objects.

I am quite confused about the preposition “for” or “to” in direct and indirect objects.
I buy a present for him
I buy a present to him
Which of them is correct and why?
Could you explain me further about 2 these preposition in use, pls?

Thanks a lot.

.
Only ‘for’ works in your sentence. ‘For’ means ‘intended to belong to’. FOR and TO both have many, many meanings and uses, Tung. Click on those links to review them.
.