Here is a trick from the old school. Imagine you are in an anchorage and the wind and swell are coming from different directions. A boat will naturally point into the wind and make sleep very comfortable...as long as the swell is from the same direction. If the boat is pointing into the wind but the swell is more than 45 degrees different, the swell will rock you out of bed! Here is a great solution to this issue so you won't lose any sleep.
More here: https://www.jmpeltier.com/2015/05/19/sleep-tight-swell-bridle/
Not many folks know about this little trick so next time you are out there and can't sleep due to a rocking boat, whip this one out!