This article from Stan Carey at the Sentence First blog, Its, it’s: It’s a problem should help you clear up any hesitation or confusion you have about when to put an apostrophe in its. It’s the most thorough treatment of the problem I have read, with 40 ! surprising and cringeworthy examples of misuse photographed from original documents or screens, even in the edited prose of such publications as The New York Times and The Economist. Using it’s when its is called for is the most way these two are mixed up — I think even more so now than when he wrote this article. And still wrong.
To be fair I should mention that Mr. Carey is generally in the descriptive linguistic camp, but he says this issue is a pet peeve of his. He admits that the scale of the its-it’s problem is not cosmic, “But careful readers will notice the mistake and consider it a sign of inattention, sloppiness, ignorance, or even illiteracy – especially if it’s repeated. So if you value good communication, it’s a distinction you ought to make, and make consistently.”
If you don’t want to read any of his article, here is a key point to remember, which alone may correct the tendency to follow the maddening crowds: It’s always, always is a contraction for it is or it has. If you start to type it’s, ask yourself if you could say one of those phrases instead. No? Then leave out the apostrophe.
Another thing that helps is to keep a list in your mind of all the possessive pronouns (noting that its is one of them), none of which have apostrophes: my, yours, his, hers, its, theirs, etc. See, even the ones ending in s do not have apostrophes. Its behaves like its siblings.
But I hope you will at least scan the article – it’s fun to take instruction from examples of professional writers goofing up, and it will freshen and reinforce your language skills so that no one will think you are sloppy or illiterate — at least not over this little word.