1st Tampon... Ouch!

Ghost
Today I put a tampon in for the first time and it was fine going in and everything, (medium flow btw) but when I was trying to get it out it hurt so much! I was crying!!!
It took a long while to get it out.
Is there something I'm doing wrong? Any tips? 
I really need help.