Well, if you knew Chinese, I would say, "thanks to" means "多亏了..." while "because of" means "因为...".
But I assume you don't. So anyway, "thanks to" is a possitive phrase which means you can't not use it in a bad case; while "because of " is a neutral phrase which means you can use it in either case.
For instance, you can't say "He is sad thanks to me", but "He is sad because of me" is OK; or "I lost my wallet thanks to my carelessness", also, "because of " here is acceptable. If you say something positive, you can use either of them, like "I got an A in math thanks to/because of my hardwork".
Got that?