If my rib cartilidge keeps popping out on a regular basis what would be the best treatment?

Several things. This is one of those problems where a visit to your doctor is necessary to figure out what's going on. Only after a thorough evaluation, including examination and possibly labs and other tests, can your doctor correctly diagnose you and treat you effectively.
How much problem? What you do depends partly on how much/often this bothers you. It is as simple as avoiding actions that seem to cause it to a rib belt that immobilizes it long enough to heal to consulting a chest surgeon.