My phone is hacked what to do?

My samsung s22ultra got hacked , let me tell you how , some one set in my house and hacked my lG smart tv so when any one connects with the tv he gets in , so this is the entrance , my friend iphone 14 got hacked too , right now my phone is on safe mode and he changed the password and i don’t want to factory reset cause of the important data on the phone which i really need , any help with that ? And can some one guide me how to clear my tv and how to reverse attack him ? Would be thankful

For your TV, you can reset it from settings. Just google the TV model and reset instructions. For your phone, if you are sure it is hacked/controlled by someone else, then disconnect it from any Wifi or mobile data (basically no Internet) and transfer your data to a storage device. Keep in mind to not connect any devices to the Internet be it TV or phone. Once you have the data, you can reset the phone too.