If you are using Ubuntu 20.04, there is a feature that should be enabled by default but isn’t.
It is the ability to click on the right side panel and both open and minimize a program. It doesn’t minimize. Here is how to fix that.
In a terminal copy and paste:
gsettings set org.gnome.shell.extensions.dash-to-dock click-action 'minimize'
Hit enter. Done.