You have two choice , one is high side switch and the other low side switch.
For the high side switch it can be done with both a Nmos or Pmos but the Nmos is complicated so Pmos will be easier to use.
In this mode (with Pmos) you connect the source to the positive supply, the drain to the load (+ side) and the other side of the load to GND.
The mosfet turns on when the gate goes lower than the source voltage more than the Vgs threshold voltage (in practice you need an even lower voltage to reduce the Vds on resistance), it turns off when the gate has a voltage that equals or is very close to the source voltage.
For the low side switch you use a Nmosfet, source to the GND, drain to the load (- side) , the other side of the load to the positive supply.
In this mode the mosfet turns on when the gate goes higher than the source voltage as much as Vgs threshold or higher (again you need higher than the Vgs-th parameter to get a low source-drain on resistance) and off when the gate level is close to the source voltage which is grounded (so you need almost 0 to the gate)
The low side switch with the Nmosfet is easier to use because when the gate gets 0 (or close) then the mosfet is off and when the gate gets 3v3 or 5v (assuming a logic level mosfet) it turns on, this is true no matter how much supply you use for the load , it can be 10v or 20v but the on/off levels will be the same.
For the high side switch (using Pmos) things are reversed and usually it is more difficult, for example if you have 10v to the source then mosfet will turn off when the gate gets 10v (or so) and on when it gets 7v or lower (as an example of a mosfet that can turn on with 3v).
As you can see controlling this directly from a MCU pin in a problem because 0 or 5v to the gate will keep the mosfet on so basically you will need a level translator to drive it with an mcu.
Now in your specific circuit, you are using a Pmosfet with a source voltage of 6v , the mosget will turn off when the gate is 0 but when you apply 5v it may be still on (depends on the threshold) so it is kind of problematic.
If there is no specific reason to use a high side switch them maybe you should consider a low side switch that can be controlled easier.