The fact that it hurts more with moving/coughing makes it sound like a musculoskeletal etiology.
For example, a fractured rib, "pulled muscle", inflamed cartilage
. For proper diagnosis and treatment, you need to be examined by your doctor. You will likely feel better when proper treatment is initiated.