You probably already know that you can shrink (or enlarge) the Dock by clicking and dragging the bar that separates the applications from folder stacks. You probably also know that you can adjust the Dock size in System Preferences, by opening the Dock & Menu Bar pane and dragging the Size slider whichever way you want.
But these tools can only take you so far. They’ll make the Dock small, but not really small. To do that, you need to open the Terminal (Applications/Utilities) and type:
defaults write com.apple.dock tilesize -integer 8
Press Return, then type:
The number at the end of the command can range from 1 (too small to be useful) up to 16 (the smallest size you can achieve with those other tools); 8 is tiny but still visible.
To make such a small Dock useful, you’ll probably want to turn on Dock magnification: In the Dock & Menu Bar system preferences pane, check the box by Magnification and adjust the slider.
If you want to get back to normal, the easiest way to revert this setting is to open that preferences pane again and use the Size slider. As soon as you click and drag it, you’ll be returned to the normal size range for the Dock.