The solution isn’t easy, but it’s doable. (iStockphoto)

QMy two girls, ages 3 and nearly 7, share a room but will not go to sleep unless each has a parent by her side until she passes out. Anything less, and it’s complete waterworks and screaming, with the little one forcing herself to throw up. How on earth do we break this awful habit? It’s been going on for about a year, and we have had no energy to fight it. We hate ending the days with them hysterically upset, so we’ve just given in to this ridiculous ritual.

AYou feel utterly alone in this struggle. And I get it. It sounds so exhausting. But I want to tell you that I receive daily calls and letters from sleepless parents who are in the same boat. So, try to take some comfort in the simple fact that you are not alone.

But we have some problems here, don’t we? To begin to understand how you came to this place, it is useful to understand why children prefer to sleep with you and will fight so hard to stay with you, night after night.

Almost every parent knows that when a baby is born, that baby wants skin-on-skin contact with a parent or caregiver 24 hours a day. In fact, the very survival of newborns depends on a caregiver strongly and physically bonding with the baby. Cuddling, strong eye contact, loving speech and skin-on-skin contact are a critical part of the maturation process for babies.

As a child grows and becomes more mature, more distance can be tolerated between this child and her caregiver. You will see that the toddler toddles away, and the 4-year-old will run down the block, and the 7-year-old will spend all day in school. Because they spend more time away from you, however, nighttimes can become especially fraught.

Children can really become needy for their parents’ attention at night. Why is this? At night, the work of the day is done and it is time to relax. What brings children the most relaxation? Being physically close to their parents. Even older children want to feel close to their attachments. At night is also when the worries begin for many children, when the room is dark and things look like scary monsters. Worrisome thoughts may enter their brain, and it is completely normal for children to be troubled by fears of death, losing their parents or some other terrible thing. Children can feel unprotected and scared, and these feelings compel them to come find their parents. (These are the children who are hopping out of bed constantly.)

I am guessing that your children showed normal signs of this nighttime worry and anxiety, and in order to make them feel better, you began to get into bed with them. The “crawl into bed with the kid” trick has an almost 100 percent success rate of sleep . . . for the child. She instantly feels safe and relaxed. But as for long-term solutions, getting into bed with the children has turned into a nightmare.

So, this has been going on for a year. I would love to give an easy solution that involves no crying for them, but I don’t see that happening. A solution will happen, but it will require a great deal of patient, gentle persistence, a good sense of humor and not rushing anything too much.

Here are some ideas:

Developmental psychologist Gordon Neufeld suggests “turning into the skid,” which here means that you can let the children know that you are going to help them sleep in their beds. Alone. Say that they might cry, be scared, worry and miss their parents terribly. Go ahead and expect all of those feelings. Welcome them. Tell the children that these feelings make total sense. This is “turning into the skid,” because rather than fighting or rationalizing these feelings away, we are making room for all of the feelings that will occur.

Keep the nighttime routine structured, gentle, loving and moving along. Don’t ask too many questions or give too many choices; that will just create more insecurity. Be sure to focus on the next meeting and tell them, “I will see you in my dreams” or “I will be in this room first thing in the morning!” And before you leave the room (if they are not yet freaking out completely), let them know you will be coming back to check on them in less than one minute. Show them the timer.

Now here is where it gets really rough. If you have a child who is throwing up because she is so upset, the amount of time you leave the room may be only 15 seconds. I know, this sounds ridiculous, but her young mind may be able to tolerate only small amounts of separation. And because your older child is also upset, just keep checking on them at the same intervals. Be quiet about it, loving and firm.

I don’t know how long this will go on.

The hope is that the children will relax when they realize you are keeping up your end of the bargain and returning for another kiss. The length of time between the visits will get longer. But because this has gone on for a year, it may take a while. Just be emotionally ready for how long and painful this will feel in the moment. But night after night, bit by bit, you will get your time and your shared adult bed back.

And no matter how bad the night before was, greet the children with smiles and hope in the morning. “We are doing it . . . you girls are really sleeping so well!” Yes, of course this is not how you feel, but someone has to be the beacon of hope. And that is you, the parent.

Whatever you do, do NOT:

•Lock the children in their rooms or keep the door shut, blocking them. This will increase their worry into a traumatic panic. It is not only unkind but will also hurt any progress you have made.

•Punish the children for crying. You created this dynamic with them; it is your responsibility to help them.

•Bribe them to stay in bed. You will be broke in a month, and you will still be sleeping with them.

•Beat yourself up if you give up and get into bed with them. You are human. Just begin again the next day.

•Lose hope. Beyond reclaiming your marriage and sleep, you are helping your children to feel and accept your boundaries. This is how resilience is built in children. It won’t be pretty, but better now than later.

And again, you know your children best, so take my ideas and make them work for you.

More from On Parenting:

I’d like to grade my teen’s grade portal

Why I’ll miss being snowed in this summer

My kid uses a landline, not a cell phone. Here’s why.