Chosen Solution

Do you have any idea what is the problem of my iphone why its randomly turn on and off by itself?

This could be a whole range of issues. Ranging from software to battery. I’d start off by resetting the phone. Then, if that’s no good, I’d replace the battery. Has it come into contact with water by any chance?