Diagnosis
Samsung TVs are notorious for having finicky Wi-Fi modules that struggle with certain router settings, especially if you have a dual-band (2.4GHz and 5GHz) network with the same name.
How to Fix It
First, give your TV a static IP address so your router doesn't keep reassigning it. Go to Settings > General > Network > Network Status > IP Settings. Change it from 'Automatic' to 'Enter manually'. You'll need to get your router's gateway address (like 192.168.1.1) and an unused IP address from your network. This often solves the dropouts. Next, in the same menu, go to 'DNS Settings' and try using a public DNS like Google's (8.8.8.8 and 8.8.4.4) instead of your ISP's.
If That Didn't Work
The nuclear option is to separate your Wi-Fi bands. Log into your router's settings (not the TV) and give your 2.4GHz and 5GHz networks different names (SSIDs). Then, connect your TV specifically to the 2.4GHz network. It's slower but has better range and stability for smart home devices like TVs.
Heads Up
A software update can sometimes break Wi-Fi. If this started after an update, you might need to do a full network reset on the TV. Go to Settings > General > Reset > Reset Network Settings. You'll have to re-enter all your passwords, but it clears corrupted connection data.