Note: We thoroughly discuss the differences between these words in the Common Grammatical Mistakes section of Grammar.com. Click here for the beginning of that discussion.
Your is the possessive form of the pronoun you.
You’re is the contraction of the words you are. In formal writing, it is perfectly acceptable to use contractions.
Many people use your when they mean “you’re” or “you are.” They might say:
Your a moron. The statement, of course, reveals the identity of the true moron.
Example: If those are your best pants, you’re going to want to change before we start the hike.