Turn off the TV with the remote control, wait for a while, then press the buttons on the remote control; Info, Menu, Mute, Power. You have to do it quickly, the TV will go into the service mode, where you will find the option to reset the settings to the factory settings. This is the most popular service code on Samsung TVs with smart functions, but not the only one, so it may not work.
Here are other service codes for various Samsung models:
Mute + 1 + 8 + 2 + Power
Display/Info + Menu + Mute + Power
Display/Info + P.STD + Mute + Power
P.STD + Help + Sleep + Power
P.STD + Menu + Sleep + Power
Sleep + P.STD + Mute + Power
of course, you click everything in turn, and quickly on the TV off.