My Samsung Galaxy S4 reboots at random

Hello. My Samsung Galaxy S4 has recently developed an annoying habit of self-rebooting at random. It can happen when I am playing games, writing messages, and one time even during a phone call. There is no consistency on what action triggers the reboot.
Are there steps I can take on my own before I send it to be repaired?
