It would be helpful to know a bit more about when these sharp pains are happening. If they are happening, for example, primarily with exercise, then they would most likely be side stitches, which are very common. We do not entirely understand what causes side stitches, but they are a benign problem that can usually be relieved by warming up slowly when exercising, by breathing deeply and slowly, and by staying well hydrated before and during exercise.
If the pains you are experiencing are occurring during rest, then I would recommend that you go see your primary care doctor
to help you figure out what is going on. Pain with deep breaths could be related to something as simple as an inflammation of the joints between the ribs (costochondritis), which would respond to rest and anti inflammatory medications. It could also be from pleuritis, an inflammation of the lining surrounding the lung, which is usually just from a viral infection but can also be associated with more serious medical problems.
If you are also having chest pain, shortness of breath, or palpitations, these are more concerning for a serious cause of the side pains, and you should seek medical care more urgently.