Than is used as a word indicating a comparison. Example: You are better than him (at braking glass with your mind or whatever).
You can easily detect when you need to use than by replacing it with in comparison to. If the sentence / phrase still makes sense, then you are using the correct form. Example: You are better in comparison to him.
Then is a word that’s usually indicating time. It is used to refer to an action that’s taking place after another action. Example: Wash your clothes and then dry them.
Typically you can replace then with after that or some other term that will highlight a sequence. Example: Wash your clothes and, after that, dry them.
Let’s also give counter examples just to get an impression of how silly they sound:
You are better after that him.
Wash your clothes and in comparison to dry them.
A particular case is the construction if … then where you need to use then even if it’s no longer possible to use a replacement. Example: If you will try then you will succeed.