Click the power button ⏻ in the panel in the upper right corner of the Ubuntu desktop.
Click your username in the dropdown menu that appears below the power button to unfold its menu options.
Click Log Out which is marked by the mouse cursor in the below screenshot. Another way of doing the same thing is to install the Log Out Button GNOME Shell Extension in Ubuntu Software which adds a Logout icon that is shown in the lower right corner of the screenshot to the right of the Power Off ⏻ icon.
Click the power button ⏻ in the panel in the upper right corner of the Ubuntu desktop.
Click your username in the dropdown menu that appears below the power button to unfold its menu options.
Click Log Out which is marked by the mouse cursor in the below screenshot. Another way of doing the same thing is to install the Log Out Button GNOME Shell Extension in Ubuntu Software which adds a Logout icon that is shown in the lower right corner of the screenshot to the right of the Power Off ⏻ icon.