I'm sorry to read about your Sony TV turns off and on by itself. Pleasse follow these steps to resolve this issue.
NOTE: Because each of these steps represents a possible solution to this issue, check to make sure that the TV is not rebooting or turning off after completing each step.
IMPORTANT: Some of the features or setting discussed in this solution may not be available on every TV or device. Refer to the supplied operations manual for model-specific information regarding any of the steps discussed in the solution. Manuals for Sony devices are available online through the Manuals/Specs/Warranty.
Make sure that the TV has the current system software (firmware). Set the BRAVIA® Sync feature to Off on the Sony® TV and other applicable Sony devices. Set the HDMI® Deep Color feature to Off on the Sony TV and other applicable Sony devices. Make sure that the devices being connected to the TV have the latest system software (firmware) update installed. NOTE: Contact the manufacturer or service provider (cable company, satellite provider or Internet Service Provider) of the device for information regarding the availability of the latest system software update.
Make sure that all of the HDMI connections on the devices are secure by unplugging and reconnecting the HDMI cable. Reset all of the device. Refer to the manual for the reset procedure on non-Sony devices. NOTE: The reset step should be completed only after trying all of the steps above. Performing a reset may cause the loss of certain personal setting.