With the default setting in Ubuntu, clicking on the app icons in the dock doesn’t minimize app window. The method below specifically target the “Dash to Dock” extension, which is the default dock extension in Ubuntu.

Paste the following command and press Enter:

gsettings set org.gnome.shell.extensions.dash-to-dock click-action 'minimize'

After applying this command, clicking again on a minimized application in the dock will restore it.