Rules: Personal pronouns must take different forms, called cases, depending on their functions in sentences. I, you, he, she, it, we, they are the subject or nominative case. A pronoun in the nominative case can be the subject or predicate nominative in a sentence. It can also act in apposition to the subject or predicate nominative. Me, you, him, her, it, us, them are in the object or accusative case. These pronouns can be used as the direct or indirect object, object of a preposition, or objective complement. Myself, yourself, himself, herself, ourselves, yourselves, and themselves are in the reflexive case. These pronouns can be used as an object when the subject refers to the same person or thing. They can also be used for emphasis.
Note: The case of who or whoever is determined inside its own clause.
Note: The case after than and as is determined by completing the elliptical clause.
Note: Themself and ourself are not real words.
Examples:
Correct: She and I go to the game. The person you want to speak with is he.
Correct: When I think about you, I stop myself. Do you really want to do it yourself?
Correct: That is the man who I think did it.
Correct: Between you and me, I know it is he who took the cards.
Correct: Whom are you looking for?
Correct: All are invited, Jane and he and my sister and I.
Correct: We are luckier than they.
Correct: I like you better than him. [better than I like him]
Correct: I like you better than he. [better than he likes you]
Practice verifying that pronouns are in the correct cases:
Resources for further explanation of pronoun case:
Purdue OWL's Pronoun Case
Web App's Pronoun Case