It is a little unclear to me from your question what you mean by trouble sleeping. I recommend that you discuss this with your pediatrician
right away. Babies who are 7 months old do not generally have problems falling asleep, but they may have trouble maintaining their oxygen levels or "remembering" to keep breathing for a few reasons.
For example, after a difficult vaginal delivery, sometimes the nerve that makes the diaphragm function can be damaged (it runs down through the neck, and can be stretched by the delivery). This could lead to a "weak diaphragm" that makes for trouble for the baby while sleeping. Many times babies can recover from this, although other times the damage to the nerve can be permanent and can require treatment, such as a "pacemaker" for the diaphragm.
Another possibility would be a defect in the diaphragm, which some babies can be born with. Usually these defects are large and cause serious problems early in live, requiring intensive care and surgery
. After the surgery, these babies still often have breathing problems that require long term therapy.
Finally, a weak muscle in the diaphragm around where the esophagus enters the stomach may lead to trouble with acid reflux
, which can also affect sleep.
It is hard to give more specific thoughts without knowing more about your baby's history, but please talk to your pediatrician for more advice and insight.