Have you tried all the usual self-repair options? It’s worth googling the brand and model of your TV and the issue. If there is a fix out there, you’ll find it pretty quickly. Also contacting the manufacturer is worthwhile. Samsung, for example, respond to email usually within 24 hours and will often offer a variety of troubleshooting options.
A very simple fix for this problem which often works is to disconnect it from the mains, and remove all peripherals. Leave it off for at least an hour. That will properly reset any settings the TV is holding on to, including resetting HDMI port chips. Then power up without connecting any peripherals and see where you’re at.
If it’s not recognising external connections you may not be able to implement my other suggestion, which would be to check for any firmware updates and install via USB.
Apologies if you’ve tried all of this already.