Fridge Cuts Off Intermittently

Hello, I am trying to figure out what is wrong with my 13 yr old Whirlpool Side-by-Side; it will run okay for several days than it will stop cooling. It’s been acting this way for a few months now. Now I keep a thermometer in the freezer to check it if is cooling properly.

When I see that it is not working, i.e. temperature nearing 50 degrees, or ice cubes melting, I pull it out from the wall and pound on it, (the side, bottom area of the freezer side, near the bottom) until it starts running again. I can hear the compressor come on.

I cleaned all the dust and dirt from under the fridge hoping maybe it was overheating and cutting off because of all the dust around the coils, but it cut off 3 days after I cleaned it out.

My icemaker quit working recently too, but that I believe is a separate matter, that I would address if I could solve the more important cooling problem.

Please advise what part may be causing my problem before my wife drags me out to buy a new one.