Sternum Pain

Searched up sternum pains on the forums but almost everything that came up was pains from doing dips/exercises. My situation’s a little bit different.

In the gym I don’t really do any exercises that annoy my sternum but the past few months, once in a while my sternum would hurt in certain positions (like squeezing my chest together) and when this does happen, it’s always after I wake up (I sleep on my sides if it matters) so it never really hurts after a workout. Usually when it happens, I somehow manage to crack my sternum and the pain goes away. Either that or it goes after a few days.

Anyone else has this issue and if so what do you do to relieve the pain? Could it be something serious that I need to get checked out?