It’s a common question - how to switch high(er) voltage loads with a microcontroller that might only be running at 3.3 or 5V?
Someone asked me to demonstrate, so I cobbled together this example of low-side switching
with an n-channel enhancement mode MOSFET controlled by an Arduino running on 5V.
As always, all notes, schematics and code are in the Little Electronics & Arduino Projects repo on GitHub