This article explains how to safely clean a TV remote control. However, the steps below also work for remotes connected to other devices.
How to Clean Your TV Remote in Under 3 Minutes
Make sure you have a cloth and some isopropyl alcohol handy. Although, soap and warm water can work too.
Be extra careful with water near your electronics. Also, make sure your remote is turned off completely before cleaning it and is completely dried before turning it back on.
First, turn off the TV and remove the batteries from the remote control (if present).