Hello. Thank you for posting.
If you suspect broken ribs and are in pain, your ribs/chest need to be evaluated out by a doctor. An x-ray may be needed. Medication can be prescribed for the pain and discomfort so you can sleep. Otherwise, drug store pain relievers may offer some relief. Doctors often recommend sleeping on your back, side, or sleeping in a recliner for rib injuries. This may vary depending on the injury and severity.