It doesn't matter.
But from a scientific point of view, the first thing is that the gas emitted by the refrigerator during refrigeration is not good for the human body.
The second is that the refrigerator is still noisy. If you are too close to the bed, it will affect your sleep.
So the refrigerator can face the bed, but not too close, at least four or five meters away.
I hope this answer is helpful to you.