Incorrect breathing is not the primary nor only cause of neck pain and bad posture.
There are many more factors such as muscular imbalance, biomechanical alignment, muscular tightness, mobility and movement proficiency that account for and contribute to the pain to a greater extent. All these factors need to be addressed before primarily focusing on breathing.
So what is the correct way to breathe at rest, during activity/ exercise?
The correct way is by using diaphragm during inhalation and exhalation, called diaphragmic breathing. As you breathe in, the diaphragm drops down which changes the pressure gradient and allows air into the lungs. Conversely, during exhalation, the diaphragm comes up and pushes air out of the lungs. This optimises oxygen exchange in the lungs thereby increasing breathing efficiency. Also, it decreases neck tension and work of the accessory muscles of breathing such as the upper trapezius, levator scapulae, scalenes and sternocleidomastoid. These muscles are most commonly overactive and tight which is one of the most common causes of neck pain.
As you can imagine, having existing neck pain and tightness alongside adopting incorrect breathing pattern which increases strain and tension on those accessory muscles will further load the neck and increase pain. Over time, this will usually cause compensatory movements and increased loading through the shoulders, thoracic/ lumbar spine, hips etc which in turn will increase pain and dysfunction.