My try:
I prefer to drink tea / I prefer drinking tea
I love to dance / I love dancing
I hate to study / I hate studying.
Using gerund or infinitive with verbs may be complicating. It would be better for you if you search gerund or infinitive in the search box on the right above. I am sure you will find lots of information.
You can use both forms with "prefer" but don't forget parallelism in the sentence. verb+to prefer verb +to,
verb+ing prefer verb+ing, verb+bare infinitive prefer verb+bare infinitive.
As for love and dance, both infinitive and gerund can be used.
Using infinitive or gerund with "hate" changes the meaning.
Talking about general dislikes: I hate listening to music, I hate going to school, I hate doing homework.
Talking about hypothetical things, situations: I hate to imagine her in such a poor situation, I hate to think taht I will be dismissed.