Freezer will get cold initially, then compressor clicks but doesn't run

I got this freezer used and was told it had been in storage for a while. Took it home and it has been running great for months now.

Just last night I noticed the compressor would click but not actually start running, then it would click once more (as if shutting off) and this would continue to happen, with the compressor never actually cycling back on, just the clicking.

I unplugged it and let it sit for an hour and the compressor kicked on and it cooled down all the way to the set temp, but after that the symptoms started again and the compressor never cycled a second time.

Just wondering what part might need replacing. Thanks.