How can I switch a 12v line with arduino using a p channel mosfet when they have the same ground
Use This circuit.
Arduino will drive your MOSFET with the help of BJT at 5V safely.



simulate this circuit &ndash; Schematic created using CircuitLab