Chosen Solution

My iPhone 6s turns off when I open camera

It could could be one of two likely faults software faultIf the camera module is sending corrupted information to the cpu it may be causing it to crash and reboot the phonehardware faultThere could be a fault with the camera causing it to draw too much current and tripping the overcurrent protection in the phone In either case you should try replacing the front and/or back cameras and see if it fixes the issue if not it may have to be looked at by a board specialist to see if there is something else wrong