With examples from Fawlty Towers and Burn Notice.
The very first thing to remember about both sets of words is that while they may sound the same, their meanings are not. The first in each instance is a possessive form, while the second is a conjunction form of two different words. The easiest way of making sure you're using the right one is to break the words up and see if the sentence still makes sense.
So, for example, a memorable quote from Fawlty Towers is as follows:
"Don't be alarmed, it's only my wife laughing."If we break up it's into either "it was" or "it is", the sentence still makes perfect sense. However, in the following example, that doesn't work:
"Oh yes, how is the old toe-nail? Still growing in? Still burrowing its way down to the bone?"Trying to use "it is", "it was", or "it has" doesn't make any sense at all. And given that Basil is talking about an ingrown toe-nail, that's definitely what he's referring to with its, and so the possessive form makes sense.
We do the same thing with your and you're. For example, in this piece of narration, Michael Westen is talking about the way he likes to do his job:
I'll take a hardware store over a gun any day. Guns make you stupid; better to fight your wars with duct tape. Duct tape makes you smart.In this example Michael is talking to the audience and they are the subject of his narration. So the possessive your is the correct usage. Breaking the words up confirms this as "you are wars" makes no sense at all. But that does work in this next example:
Need to go someplace you're not wanted? Any uniform store will sell you a messenger outfit, and any messenger can get past a security desk.After substituting "you are" the sentence still reads correctly, so we know it's the right usage.
So if you get confused, break the words up. If the sentence still makes sense, use the version with the apostrophe. If not, then you likely need the possessive form. However, as melayneseahawk said, you will make mistakes, and the best solution is a beta or two who nitpick well. It's certainly saved me on more than one occasion!