Posture + exercise
In the absence of other medical problems, one of the best things someone who is relatively young can do is to get more exercise
, and specifically more abdominal exercises.
Having proper posture at a chair or desk can help too. Sit up right, flex your abs, keep both feet flat on the floor or on a stool, and avoid leaning on the armrests while typing.
If the pain persists, you should get a physical.