contractions? help

How do I know if I'm having contractions or when to call a doctor. I'm 36 weeks and I have light cramping in my abdomen and the right side of my stomach keeps hardening and then soft but it just feels like the baby is leaning against that side and then moving away idk if it's that or if it's contractions ? I'm confused