Having trouble with MOSFET

You will need a flyback diode across the relay winding to prevent inductive spikes damaging the MOSFET.