PWM driving of a DC/DC Converter with Arduino nano

I tried with digitalWrite first, but it didn't have any effect, that's why i ended up setting the PWM off and on for each mode.

Yes, setting the PWM off and on for each mode is correct. My question is about the desired state of the pin/FET which is not putting out the PWM. (i.e. the output which is turned off).