My device is freezing and restarting

My device is either freezing or restarting, and i do not know why.