Inflammatory costochondritis is in most cases caused by a lack of fitness, hunched posture, spinal stiffness or hypermobility, fear of movement and activity aggravating pain and ergonomically disastrous workstations and unhealthy lifestyle choices.
The best way to treat or prevent it is to choose and implement healthy ergonomics (sit/stand desks), get professional help from an experienced osteopath, chiropractor or physiotherapist to reset your posture, move frequently, start a good diet (tending to vegetarianism) and graduated, regular non-impact exercise until you recover fully.
When you’re sitting at work or at home scoop your chest in and push it out – then make circling movements with your chest, first one way and then the other. Do breaststroke and backstroke movements every half an hour for a few seconds to mobilise your shoulders, ribs and chest and maintain movement and flexibility and to remind you to sit upright. Set your screen at eye-level to stop you dropping your chest or poking your chin forwards.
Source : NHS