If you leave one country and settle down in another, you’ve technically emigrated and immigrated—but when to use each verb depends on which end of the trip you’re talking about.
As Merriam-Webster explains, both emigrate and immigrate derive from the Latin verb migrare, which means “to move from one place to another.” Or, as you might already be thinking, “to migrate.” To understand the difference between the two terms, you really just have to subtract the migrate and look at the remaining letters.
For emigrate, it’s e-, a shortened form of the prefix ex-, meaning “out of” or “from.” Like exclude and excavate, the word emigrate refers to taking something out of something else. So if you mention emigrating, you should be referring to emigrating from a place. You can’t, grammatically speaking, emigrate to a country. But you can immigrate to one. The prefix im- means “in” or “into” (it can also mean “not,” but not in this case), as in implant or impregnate. So immigrate should only be used when talking about immigrating to a place. To help you remember the difference, Grammarly has a handy mnemonic device: Immigrate and into both start with i, while emigrate and exit both start with e.
Knowing which noun form to use for a person—emigrant or immigrant—is a little less straightforward, since they’re not (usually) followed by the aforementioned prepositions. In general, you’ll have to rely on context clues. If you’re writing a story about a family of fairies preparing to leave their humble hollow forever, you probably want to call them “emigrants.” Once they reach that far-off forest and settle down in an idyllic glen, you can switch to “immigrants.”