Both of these groupings consist of homophones, words that sound (phone) the same (homo). As with many homophones, it's easy to type them out quickly and "hear" them correctly as you read back over them, so it's a good idea to get in the habit of scanning for these easily confused words and double-checking their use.
two: is always and only the number 2.
Benton Fraser has had two partners named Ray.
too: can be a modifier meaning "excessively," or can mean "also."
Inspector Thatcher might say even one Ray was one too many.
There are days Lt. Welsh might agree, too.
[Hint for remembering the spelling for both meanings: There are too many O's in "too." There is one O, and another O, too.]
to: is a preposition, or used to form the infinitive of a verb. Use "to" in all instances that aren't "2" or "excessively" or "also."
Fraser insisted he wanted to walk to the consulate.
their: is a possessive pronoun.
The weapons smugglers have a slight issue with Vala stealing their spaceship.
they're: is a contraction of "they are" or "they were."
And by issue, read: they're hot on her trail, seeking revenge.
[Hint for remembering this spelling: As with all contractions, the apostrophe takes the place of the missing letter(s). If you can read the sentence as "they are" or "they were," then use the apostrophe.]
there: is an adverb indicating location, literally or metaphorically, or an exclamation. Use "there" in all instances that aren't the possessive or "they are/were."
They track the ship's signal to a planet, but Vala's not there when they arrive.
"There!" says Vala, smiling brightly at SG-1. "All captured in my trap."
[Hint for remembering "there" as location: "There" is spelled in the same manner as its opposite, "here."]
(There is also another near-homonym which can get confused with these three. There're expands to "there are" or "there were," so watch for it as well.)
Mistakes will happen as you type these words; it's inevitable. Train yourself to take a second look at these words on reread, and test them out in context for the correct meaning and spelling.