Refrigerator not cooling

Refrigerator does not cool properly. Makes clicking noise, then hums, clicks again. Freezer is not frozen up. This happened some months ago and then it started to work fine. Thank you.