Short answer: run defaults delete com.apple.dock; killall Dock in Terminal.
That returns the Dock to how it looked on a brand new Mac. It also removes every app you added to it, so read the warning below before you run it.
Resetting the Dock is not a repair that leaves your setup intact. It wipes every Dock preference you have, including:
What it does not touch is anything outside the Dock. Your apps are not uninstalled, your files are untouched, and nothing leaves your Mac. Only the Dock's own configuration is cleared.
If your Dock is merely the wrong size and otherwise fine, you do not need this. See why your Dock keeps changing size instead.
Open Terminal, from Applications then Utilities, or press Command and Space and type Terminal. Paste this and press Return:
defaults delete com.apple.dock; killall Dock
The Dock disappears for a second and comes back at Apple's defaults. Two parts are doing the work. defaults delete com.apple.dock removes the stored preferences, and killall Dock restarts the Dock so it rebuilds from scratch. Without the second part nothing appears to happen.
If Terminal replies that the domain does not exist, the preferences were already cleared. Run killall Dock on its own.
Same outcome, no Terminal. Useful if the Dock is misbehaving badly enough that you suspect a damaged file.
~/Library/Preferences and press Return.com.apple.dock.plist and move it to the Trash.macOS writes a fresh file with default values. If your Dock has been resetting itself on every login, or refuses to keep a setting, a damaged file here is the usual cause and this is the fix.
You often do not need the full reset. Each piece can be put back on its own, without losing your apps:
killall Dock on its own fixes a Dock that has become unresponsive, without changing any settings.If you are resetting because the Dock keeps drifting from how you set it, the reset treats the symptom. The cause is that macOS lets the Dock be changed by an accidental drag, and offers no way to pin it.
You can pin it yourself. Once your Dock is how you want it, run:
defaults write com.apple.dock size-immutable -bool true; killall Dock
That freezes the size. There are equivalent settings for position, contents and auto-hide, listed in our guide to all four. Swap true for false to release any of them.
If you would rather not hold four commands in your head, Locking your Mac's Dock with Still Dock puts the same four locks in your menu bar as switches, and remembers the Dock you had before you locked it so you can always get back to it.
Using more than one screen? The Dock also jumps between them, which is a separate problem with its own fixes: how to keep the Mac Dock on one screen.
No. It only clears the Dock's preferences. Your applications stay installed and your files are untouched. You will need to drag your favourite apps back onto the Dock afterwards.
Yes. Before resetting, copy the preference file somewhere safe: cp ~/Library/Preferences/com.apple.dock.plist ~/Desktop/dock-backup.plist. To restore it, copy it back and run killall Dock.
Usually a damaged preference file, which the file-deletion method above fixes. On a managed Mac, from work or school, a configuration profile may be enforcing the Dock instead, and that cannot be overridden locally. If your Dock settings are also greyed out, see why macOS says a profile configured them.
Try killall Dock first, since that restarts it without losing anything. If the Dock still does not appear, then the full reset is the next step.