On the login screen, you should be able to select "Ubuntu on Wayland" by clicking on the settings icon, next to the login button.
If that option is not available under the cog icon on the password screen, make sure that
WaylandEnable=false is commented out (or not present) in
Mine looks like this:
# GDM configuration storage
# See /usr/share/gdm/gdm.schemas for a list of available options.
# Uncoment the line below to force the login screen to use Xorg
# Enabling automatic login
# AutomaticLoginEnable = true
# AutomaticLogin = user1
# Enabling timed login
# TimedLoginEnable = true
# TimedLogin = user1
# TimedLoginDelay = 10
# Uncomment the line below to turn on debugging
# More verbose logs
# Additionally lets the X server dump core if it crashes
If you cannot log in to change this, start Ubuntu into recovery mode, go into root shell, and mount root partition as read/write: How do I boot into recovery mode?
From there edit the GDM config with
nano /etc/gdm3/custom.conf and comment out the WaylandEnable line: