When I started out I had a couple of ordinary pillows and started on my left (stoma on my right) and wedged the pillows behind me so I could lie back into the pillows but stay on my left. You can make it so it feels lovely and snuggly and luxurious and like you're being taken care of. Also, have a towel nearby so if your bag comes loose you have a chance of containing things.
With an ileostomy I usually get up 2-4 times in the night to empty my bag. I changed from a huge bag because it was so heavy and uncomfortable when it filled up - & I'm 5' so it hung a bit low for me. I've tried to develop and attitude of mind that it's OK to wake up, wmpty bag - while 1/2 asleep, get back into bed and zzzz. At first I set my alarm every few hours until I trained my body to wake me up when my bag needs emptying. I think key is to accept that your life has changed and your habits will change. Don't fight it or resent it - that just makes sleeping more difficult.
Have a look at the 4 stages of sleep. Stage 3 is when tissue repair and regrow happens. Which is important recovering from surgery. Stage 4 is REM, deep sleep, when dreams and memories form - so we process what's gone on during the day/ the past - the cognitive side of things, I guess, processing trauma. Stages 1-4 repeat during the night. The first lot of REM starts 90 minutes in. I've only just come across this - so I don't have full information. There are watches that will record how much sleep you have in each stage and the quality of your sleep. That's if you can wear a watch full time.
And you can catch up during the day. I think hour around midday is the most useful to health - that's the current thinking (in the UK).