IMHO the easiest way to connect to a Wi-Fi network if you have only a terminal
Just type nmtui
in the terminal(CTRL+Alt+t). The rest is self-explanatory select which way you want to connect LAN or Wi-Fi type in your PW, confirm done.
Further reading
https://linoxide.com/connect-wifi-from-terminal-on-ubuntu-20-04/