Then is mainly an adverb, often used to situate actions in time. For example, you wake up in the morning and then have breakfast. It’s also used in if … then constructions such as, “If you wake late, then you might have to skip breakfast.” It also works as a noun meaning that time (e.g., “I wanted breakfast, but then was not a good time”) and as an adjective meaning at that time (e.g., “My then boyfriend was not an early riser”).
Than is a conjunction used mainly in making comparisons—e.g., “My breakfast is better than yours”; “I make breakfast differently than you do.”
To help distinguish between the two words, remember that than has no one-word synonyms. It is a one-of-a-kind word. To illustrate, try thinking of a single word to replace than in “My breakfast is better than yours.” There isn’t one. Then, in contrast, has many synonyms and often bears replacement with an equivalent word or phrase. For instance, “I woke up and then had breakfast” can become “I woke up and subsequently had breakfast.” The exception is in if … then constructions, where the then is usually required. But for these situations, just remember that then, not than, is the correct spelling of the word often paired with if.
Lawmakers would then turn their attention to a financial regulatory overhaul, and then pick up where they left off on health care. [Star Tribune]
The then President Olusegun Obasanjo gave him his full backing. [Punch]
By then, he was increasingly viewed like a precocious child whose manner had soured from cute to insufferable. [Gazette Net]
If this is the case, then it exists alongside a surprisingly resilient sense of class belonging. [The Age]
For Wizards, more questions than answers [Washington Post]
Getting excited about my wedding rather than my marriage was a red flag. [Psychology Today]