Install a new black wire to the bottom wire screw on the switch located beneath the top connection just made. Hi in this video im showing how to make a light spur from socket outlet thats on ring circuit.

How To Replace An Outlet That S Controlled By A Light Switch
How to wire a light switch from a plug socket. The red wire would be used as the switched leg back up to the vanity light where it would be connected to the black wire of the vanity light. Put in the new socket box and pull the cable through it. In this case if you have a neutral and a ground you can run 14 2 wire to an outlet. Switch on the light to see if its working. The black wire should be installed at the top wire screw on the back side of the switch. In the in line method the switch is in line with the power to the load so power comes into the switch box.
This kind of task is really useful if you have a source of power where you can plug in a light but want to place the switch in a more convenient. Install a 3 wire cable of the same wire gauge from the vanity light to the wall switch. Learn how to wire up a plug in light and switch. Conversely you can connect the switch for a new light fixture to a nearby outlet which is a procedure similar to wiring outlets in series. Screw the socket into place and turn power back on. Connect the two twisted wires back into the switch terminal.
Connect the black incoming wire to the switch to be installed in the circuit using the screwdriver. You can plug something into the socket to see if its working. Put back the switch cover. The procedure is not unlike wiring multiple lights to a single switch. The hot path for electricity should run through the narrow plug prong at the wall outlet to the hot terminal on the switch and to the hot button at the base of the socket when the switch is on. You can even wire the switch to control the outlet which is a great option if you prefer a plug in light fixture to a permanent one.
Splice and strip individual wires and connect them to the right terminals on the socket. The black and white would be used for the power for the outlet and the vanity light switch. The neutral path should run from the wide prong at the wall outlet through a marked insulation wire to the neutral terminal on the switch and to the threaded metal bulb socket.