Hotels
In a pay/per/night kind of establishment like a hotel, go to the front desk and complain. They should be able to accommodate you (either by moving you to a new room or by swapping the fridge or by reimbursing you some amount).
In the future, be sure to specify that your room be not noisy — away from elevators and the like — when booking it. This will ideally prevent the desk clerk from shrugging and saying, sorry, tough beans.
Apartments
In a landlord kind of establishment like an apartment, inform your landlord. Unless stated otherwise in your contract (US only, IDK about other countries), the landlord is responsible for the general working upkeep of appliances in the apartment.
I've been in apartments where the fridge was crap, and I got a better one off of the local paper / exchange / whatever for cheap. The landlord had always approved the swap for a newer, better model. (But make sure you get permission! Because you can lose your deposit, among other, worse, things if you do it without first getting approval.)
Refrigerators
There are only a very few things that will cause a refrigerator to make loud noises:
- physical damage / bending
- maintenance / de-icing cycle problems
- failing compressor
- something worse that means the fridge is bricked
In the first case, listen to the machine to determine where the noise is coming from. It could simply be that the compressor is causing something to rattle, such as one of the refrigerant lines to knock against the housing. If that is the case, only a very small push or pull to bend the line a little away from the thing it is contacting is all that is needed to quiet it.
(This happens when someone is not careful when transporting the unit. The frame itself can be bent or twisted, or the metal panel around the compressor compartment, or the refrigerant lines themselves — all in ways that are not immediately obvious to the casual observer.)
Fortunately, the lines are very malleable and are designed to bend. Don't be aggressive, though. Just push it only enough to prevent it from striking the frame. If you break it you are liable, and any competent professional who looks at it will know full well that you broke it if you do. And a refrigerant leak is not your friend.
In one case, the compressor was just old and rattling everything. A hard rubber ball from the dollar store jammed between it and the support frame was all that was needed to quiet it down.
De-icing and compressor problems are best fixed by a professional. And a failing refrigerator will be properly diagnosed by one.
In all cases, the owner is responsible for the proper maintenance — he/she just needs to know that maintenance is required.