Fridge and freezer quit cooling

Our refrigerator suddenly stopped cooling over the weekend. We tried unplugging it and plugging it back in and the compressor would kick on and it would be fine for a while, then it would quit again and get warm. Everytime we unplugged it and plugged it back in, it would start working again. My husband replaced the defrost timer in it and it worked for about 2 days, then quit again some time last night. He cleaned a bunch of gunk off of the coils and underneath the unit, too. Any advice? :confused: