refrigerator freezer on top

Both fridge and freezer were getting too warm.I replaced the compressor start relay and seemed fine for a few days.Now when I notice it’s not cooling , I lightly tap the controll panel where the thermostat and lights etc. are it kicks in and gets ice cold again. It might stay running a little longer than it should and if I lightly tap again it will shut off.I was wondering about replacing the thermostat or the main board.The thermostat is alot cheaper. Any help with this would be just wonderful.Thanks

Here are your parts
Replacement parts for WHIRLPOOL GT2SHMXMS01 Refrigerator | AppliancePartsPros.com

Here is the tech sheet
http://www.servicematters.com/docs/wiring/Wiring%20Sheet%20-%202225762.pdf

It is pretty hard to troubleshoot.
As you can see the thermostat and the relay on the board are wired in series and are also located close together so it is hard to tell which one you are affecting when you tap on the console.

I would try just turning the thermostat knob, if this causes it to start up then I would replace the thermostat first. Still a bit of a crap shoot but your odds are better.