it's not easy to repair the EROM.
read this:
Upgrading or repairing the EROM (FOTA) in phones CID 49 or CID 51 with Phone XS - Top Sony Forums

first you didn't mention your phone model, thats important so somebody can help you, and second i don't think you can do it at home, it's better to take your phone to a service center, you might kill it for good.