Than is used when you are drawing comparisons between things or people. Than is also a word that follows words like 'other', 'rather', 'less' , 'more'.
Then is used when you are talking about something related to time, it is followed by words like 'until', 'since' or phrases such as 'back then', just then'.
It will take a little time to master these but keep practicing and you will get there.
Doubts on this article