What should I do

**I have an old phone I used to charge it through the cable to pc and to transferm some photos and printed them as well as I used to charge my other family phones through usb in my pc there was someone how put maybe some spy files in my old phone or maybe hacked it he have my phone number and gps he didn’t have physically attach to the phone but he starting to tell me things in my phone and my social media accounts and they were true so I decided the previous month to leave my old phone I put it turn off all the time and I turned off in it WiFi gps Bluetooth but the problem I did that after many times that I charged my new phone and my family phones with same cable in same usb in pc and I transformed some pictures from my new phones and the old one to the pc and I print them ,so I decided to format my new phone by choosing delete all the data and setting I continue to charge my phone with one of my family phones we start to uses the same charger and his phone I used to connect as well with that pc through the old cable so I think it is maybe affected but I didn’t format it and I don’t know if I used the new cable of his charger before and connect to pc or not but honestly I remember I use it 🤦‍♀️🤦‍♀️🤦‍♀️🤦‍♀️so today I decided to format my phone again so during the format process the phone turned off the battery was low so I quickly connect it to the charger ‘the charger was in the wall but the problem is I don’t know if I connect the cable of it to my pc before butvand the process of deleting settings and data begin while I was charging my phone and I am afraid that maybe this virus will be inside the system of phone because I was charging it through our cable while formatting it So I decided to format it again without the charger and I did it but I am afraid that maybe the virus or spy files or malware …etc will be inside the system and even formatting my phone will no help😰 and is there is any way I can be sure that my pc can transform the malware …etc during our phones so I can make sure or there is anyway I can know if I connect the other cable to my pc or not because it is the one that I format my phone in it again