There are two different ways to go about adding an icon to your dock. You can either get it done in Terminal or use an application.
Add a Blank Space with Terminal
Open Terminal. You can find the application in your utilities folder which can be accessed via Finder at “Applications -> Utilities.” For faster access, type “Terminal” into Spotlight (triggered by the magnifying glass in the upper-right corner of your screen), and press Enter to launch Terminal.
Copy and paste the following text into Terminal and press Enter:
If you’re curious, this command works by adjusting the default settings for the Dock, adding a “spacer tile” that acts like an application icon but is blank. (The last part of the command, killall Dock, restarts the Dock so your changes can take effect.) 3. Your dock will disappear for a moment as it restarts itself. After a second it will return with a new blank space placed after your last permanent icon. 4. Drag the blank space to wherever you’d like to keep it. How do you click on a blank thing? Just like a regular icon, actually.
Add a Blank Space with MacPilot
Download and install the trial version of MacPilot from the developer’s website.
Open the application. Click “Dock” in the left-hand menu pane.
Click the button labeled “Add Spacer to Left.”
At the resulting dialog box, click “Quit Open Applications.” This will shut down the Dock temporarily.
When the Dock reappears after a couple of seconds, you’ll see a new blank space added to your Dock.
You can continue to add blank spaces to your Dock by repeating steps four and five. If you want to add a bunch, tick “Quit these applications automatically in the future” to cut out step five. The Dock will then automatically restart each time you add a new space.
If you’re feeling adventurous, or you want to go a little further in your customization, click “Add Spacer to Right.” This will add a blank space near your Trash and any folders stacks you have pinned there as seen below.
Removing Blank Spaces
Regardless of the method you choose, any blank spaces you add will persist until you manually remove them from the Dock. You can do this in exactly the same way you would remove a regular icon: right-click and select “Remove from Dock” or drag the icon away from the Dock.