Use the driver as you would normally:

Drivers will default to retryWrites=true with MongoDB 4.2