What is to be used to switch the load: Relay or MOSFET?
If you want to use a MOSFET, my preference, you need to chose one suitable for the application. This includes current, voltage, load, etc. With the Arduino you need a Logic Level preferably a UIS rated mosfet. The MOSFET must be properly enhanced (see graph on data sheet) to determine the Vgs voltage required to do this. Keep your load and allowable voltage drop in mind. Be sure the grounds are connected. When it is on measure the voltage between the source and drain, it should be less than 0.2 volts, if more you are not properly driving it.  The IRF540  is not designed for logic level inputs. Its threshold can be as high as 4 volts. With the Arduino it is wise to put a pull down or pull up resistor to guarantee the output state while it is in reset and your code takes over. This will prevent output glitches.