Automation

I have a program that I need to keep running all the time but the problem is, if it runs for like a day or more than a few hours it crashes, but the thing is they usually do that while I am at work or something so is there programs out there that will run that program again if it crashes?