Instance restarting on its own for no reason

I am dealing with a very frustrating problem. My worker restarts on its own for no reason and it’s causing problems every single time this restart is not triggered by me. How can I fix this?