RocketChat service fails every other day - how to restart service on failure?

Rocket.chat service file is here: /etc/systemd/system/rocketchat.service

You can add Restart=on-failure in the [Service] section.

edit:
(What are the ram specs of your server?)

Also see this thread about app ram usage