There is a common problem with many of the Samsung TVs. If your remote works intermittently you may have a bad wireless network card. This is relatively easy to fix. The card can be replaced or just unplugged if you don’t need it. I unplugged my card and left it in since my TV is connected via ethernet.
You have to take the back of the TV off to access the card. On my 55" UN55H6350 I had to remove about 20 phillips head screws. Once you remove the back, the card is held on with one screw and is is connected with a ribbon type connection. My wireless card is the “'''Samsung BN59-01174A Wi-Fi Module”''' and this fits many other TVs. If you search on that part number you will find many sources for the part and videos on how to remove it. It sells for about $40 from Samsung and less elsewhere.