You haven't posted specs for your motor - an existing motor driver board may fit the bill too.
Standard opto-couplers are often too slow for PWM gate drive, note(*). Use specialist MOSFET gate
driver chips to drive MOSFET gates unless you've a compelling reason not to. If you do use
opto couplers use logic-speed opto-couplers on the inputs to the gate drivers.
(*) result is overheating MOSFETs, as they are being switched far too slowly (many us, rather than
a 100ns or so).