What to do when Samsung Galaxy S7 Edge keep restarting on its own?

I bought this s7 edge less then a m9nth bqck and it keeps restarting on its own

Did anything happen before that started happening? It can be your phone fell, installed or update an app?

Not the answer you were looking for?