In Ubuntu you can restart the GNOME Shell or the GUI with using below methods. There are several different methods available in Ubuntu to restart the Gnome shell. You can do it with and without closing or shutting down all other application. It will help to recover Gnome Desktop freezes or apply the changes in system settings.
Restart Gnome Shell without closing other programs
In your GNOME desktop press ALT + F2 key combination together. I will open the command box, just type r in the command box and press the Enter key.
It will not close all application if you are using X11. If you are using wayland then it will close all other applications.
You can do the same thing using the command line. Open the terminal (ctrl+alt+t) command-line application and run this command.
busctl --user call org.gnome.Shell /org/gnome/Shell org.gnome.Shell Eval s 'Meta.restart("Restarting…")'
Restart Gnome Shell
Below methods close your running applications.
Using this method will kill some application and extensions in your desktop. Only use this method if above two will not work for you. In terminal run this below command.
killall -HUP gnome-shell
Simply restart your Gnome shell GUI by Log Out and then Log In again.
Open the terminal and run this command to restart your Gnome GUI
sudo systemctl restart systemd-logind
If you are using GDM, then run below in terminal.
sudo systemctl restart gdm
And if you are using LightDM, then run
sudo systemctl restart lightdm
In older Gnome (that is before Gnome 3.28) you can use this command to restart GNome shell.