On the computer specifically, since you said moving it is not easy — it is usually easier than it sounds and it is the single biggest win available.
The options in ascending order of effort:
A long cable. A USB extension or a longer monitor cable and the machine goes on the far side of the room, behind furniture, or out of the door. Two or three metres of distance is a large reduction.
Point it away and put something soft between. Even a duvet over the back of a chair between you and the machine helps at the frequencies fans produce.
Stop it working during takes. A lot of fan noise is the machine doing something it does not need to do — a backup, an indexer, a browser with forty tabs. Fans that spin up during recording are usually responding to load you can simply not create.
Fix the fan curve if it is a desktop you control. Many run far more aggressively than they need to at idle.
On the fridge and the traffic: those need mass, not foam, and mass is what you cannot do in a rented bedroom. What you can do is time it. Record when the road is quiet and unplug the fridge for the take, with a note on the door so nobody wonders. That sounds unserious and it is what a lot of people actually do, because it works completely and costs nothing.