Neck pain

So my neck has been hurting and it cracks a lot every time I move my head it will crack or crinkle. Sometimes it does hurt when I crack it does anyone know why it’s like this. It’s been going on for months