I started having sleep deprivation from trimester 2 when baby got bigger and heavier, and pelvis and ribs will hurt. But I've got the luxury of wfh, and so I've learnt to take naps whenever I'm tired. So now, my sleeping times are like 4am to 9am, and then in the afternoon when I'm tired, I take hour naps, maybe 3 to 5, and sometimes I'll take naps at like 10pm etc.
If you try to sleep and can't, then stand up walk a little, change your posture, go to the washroom, sit down for a while, maybe sit on yoga ball for a bit, relax your pelvis, then go back to sleep. Laying down in one position too much causes your ribs and pelvis to hurt even more and makes it harder to sleep. Maybe can also ask your hubby to help abit by giving you massages, easier to fall asleep also.