You'd use one of the rolling code mechanisms like in a keyless entry system, garage door opener or a car key fob. Maybe symmetric or asymmetric cryptography instead or on top. Depends on the exact use-case. But you'd have to build the remote yourself, I don't think that's in the readily available consumer products.
If you want it less complicated, have a look at Bluetooth or ESP-NOW. Wifi and Bluetooth and other protocols have encryption handled for you.