The only solution is to leave your phone on the other side of the room or if you can help it, another room entirely.
But seriously, sleep hygiene is an important aspect of basic hygiene that should be more broadly taught, but isn't.
Are your walls conductive, eg, largely made of water with various electrolytes? Because otherwise the comparison is senseless. Imagine putting an 8mm or so layer of of skin/fat/bone across each wall. By what factor would that reduce received power on the other side of the wall.
The max power out of a wifi router is 100 mW, that is a tenth of a watt. The amount of power impinging on your body from any reasonable distance will reduce that power quadratically. The amount of power which makes it through your skin and bone to get to your brain, considering it is 2.2 GHz or 5 GHz, is another factor lower.