Apostrophes are used for omission or possession. An example of omission is "I'm" - which is an abbreviation of "I am". An example of possession is "Sarah's car", where the car belongs to Sarah, therefore an apostrophe is required to make the proper noun possessive.
Apostrophes can be a little bit tricky because of the rules about singular nouns or names already ending in -s, plural nouns which do not end in an -s, and the specific case of "it's" and "its". "It's" is used as a contraction of "it is" and thus follows all the rules you already know about the apostrophe showing where a letter or letters have been omitted. Here the apostrophe shows that the i of "is" has been omitted. But "it's" looks exactly like you would expect an apostrophe of possession to look. Why can't "it's" be used in place of "horse's" in the phrase, "horse's mane"? It's helpful to remember that "it" is a pronoun and the possessive form behaves therefore like "yours", "hers" and "his", which also do not have apostrophes before (or after) the -s.
Here are some revision questions to help you to learn and practise using apostrophes!