You can design a circuit that has to be triggered every 1mS so that it resets. If it is not reset, it reset the microcontroller. This is a HARDWARE WATCHDOG
Most microcontrollers have an inbuilt watchdog that must be rest on a regular basis. This is called SOFTWARE WATCHDOG TIMING