Post-hip replacement, whenever I wanted to roll over or get out of bed, it was mandatory to place a pillow between my legs, then do a log roll.
It's just as it sounds, except that you are the log. In one fluid movement, keeping your body as straight as possible, roll to your right or left, just like a log that is set in motion. Be the log! That reminds me of a professor I had in university, but that's another story for another day.
This move has come in handy, upon more than one occasion.
If you're going for surgery, or have back pain, I suggest that you work on this maneuver.