Best power transistor for a high PWM output from ESP32
You can use a small logic-level MOSFET to switch 400mA, eg. AO3400A. The IRL3705 will probably work too, but it is not characterized for 3.3V drive and has a lot more gate charge (more than 10x) so it will switch more slowly.