Then and than are both function words (like prepositions and conjunctions). Many English function words begin with th- (e.g. this, they, that), which is because they were originally borrowed into English from the Old Norse language.
You might run into a variety of ideas about the part-of-speech of these words, because they are complex, but don’t overthink it. Understanding how these words function is not too difficult.
Then
Then is mainly an adverb or noun (an adverbial noun, really) that functions like a pronoun for time. Just as we can point to an un-named person as she, he, or they, we can refer to an un-specified (but definite) time as then:
Then (at that time), we arrived.
To remember that then is the one that refers to time, just think of the word when, which rhymes with then and also refers to time.
It can also be used exactly the same way as other temporal (time-related) adverbial nouns, such as today:
Today (Then), we will leave.
At noon (Then), we eat lunch.
Then does have other uses, which may seem tricky – but they are all related to the two uses shown here:
First we will find our hotel, then go eat.
If you disagree, then you should say so.
In the first example, then still refers to time, but it is used as a conjunction, meaning ‘next,’ or ‘afterwards,’ or sometimes, simply ‘at that time’:
When your brother arrives, then we will all be here.
In the second example (‘If you disagree . . .’), then expresses logical consequence—if A then B. Here it is similar in meaning to thus, therefore, or some uses of so. We might say it means ‘because of this’.
This use of then is simply a metaphor for logical consequence, based on time. If A then B means that B follows A. Now then (now, therefore) to conclude, then has a simple meaning—‘at this time’—which can also be used as a metaphor for the phrase, for this reason.
Than
Than, in contrast, is a completely unrelated word. It may be thought of as a conjunction (like and, but, so, thus, etc.) and a preposition (like of, for, in, at, etc.). Like a conjunction, it connects two words that are being contrasted, and like a preposition, it is most often followed by a noun, although it can also be used with adjectives, verbs, and adverbs:
I like sushi more than hamburgers. (contrasting nouns)
The sky looks orange rather than blue right now. (contrasting adjectives)
Easier said than done. (contrasting verbs)
Note that in the second sentence, rather than means "not." This explains another common use of than:
I would not eat anything other than sushi, if I had a choice.
In addition to more than, less than, rather than, and other than, we can also use than after any word in comparative form:
She is smarter than her sister.
You shouldn’t drive faster than the speed limit.
In the first example, it looks like the two contrasted items are not directly comparable (smarter vs. sister); after all, you see an adjective contrasted with a noun. This is because the sentence is really a shorter way to say, She is smarter than her sister is smart. We drop off the repetitive phrase is smart since it is already clear.
In any case, than must follow more, less, rather, other, or another word in comparative -er form—although sometimes, not immediately after (e.g. easier said than done) – and it must come between two ideas being compared.