nRF52840 with optocoupler and mosfet
There's a couple of problems with your circuit - the mosfet won't like much over 20V on it's gate and your circuit doesn't limit it. The 100nF cap is of little use across the led of the opto - why did you place it there?
The opto coupler is really a waste of time - it adds very little. You'd be better off to chose a mosfet that has a logic level gate.