Navigate to Applications > Utilities > Terminal.

defaults write persistent-apps -array-add '{tile-data={}; tile-type="spacer-tile";}'

Then, paste the following and press enter:

killall Dock

The dock will now refresh itself and a spacer will appear. You can move it by dragging it around with your mouse. For additional spacers, simply repeat the step above. To remove a spacer, right click it and select "Remove from dock".

Did you know you can also auto-hide your dock in macOS?

Make your Dock even easier to use!
2 minutes

When customizing your Mac's Appearance, a good place to start is by changing your Mac's Dock.