The head of the bed comes first
Old texts say the head of the bed should sit against something solid: a wall behind it, nothing heavy overhead (wall cabinets, air-conditioning units, thick frames), not facing the door, not facing a mirror, not in a window draught. Behind all of it is one idea — a sleeping person needs stability, not a position that can be disturbed at any moment.
If the room forces the bed under a window, the fallback is a heavier curtain, a hand's width of separation between headboard and window, and no direct draught across your head.