The Disengage action is what is meant to deal with this. It allows you to run around more freely for a turn and still use your bonus action, while not provoking attacks **Disengage **
Disengage
If you take the Disengage action, your Movement doesn’t provoke opportunity attacks for the rest of the turn.