'Thanks for' and 'Thank you for' is what you say when you are speaking directly to another person and you thank them for something: "Thanks (or thank you) for the birthday present, Grandma" or "Thank you for all your help, guys".
'Thanks to' and 'Thank you to' can be used when you are telling people that you want to say 'Thank you' to someone else. For example, in a speech, you might say 'Thanks to ... ' or something like 'A big thank you to..' and then name the people who have helped you ( your family, your colleagues).
'Thanks to' can also function as a conjunction in a sentence. In this case, 'Thanks to' means the same as BECAUSE OF. For example: 'Thanks to the quarantine measures, the virus has been contained.'
I hope that helps.