How to create an off switch for a socket that doesn't have one using a light switch?
If you are building from scratch, go ahead and put a wall switch next to the outlet. Then wire the wall switch so it is between the mains and the outlet.

If you just want to retrofit one outlet or so, you could add something like this to an existing socket:



This model has a local button, and also supports Z-wave for wireless switching.

Here's another version which supports Alexa/Google Home.