Trying to understand why MOSFET is not switching
What you made is called a "source follower"
Its function is to copy the voltage from the gate to the source (and here across your load) with a certain voltage drop. This voltage drop is at least the threshold voltage + some voltage the NMOS needs to turn itself on.

In such a circuit the NMOS does not switch fully on/off !

You need a slightly different circuit:







simulate this circuit &ndash; Schematic created using CircuitLab

In this circuit the 5V will be between gate and source which will turn the NMOS full on which is what you need.