I know the sudo password, can I use sudo and install software without logging out and switching to the admin user? I have two accounts on my MacBook (runs Catalina 15.1), one is admin, one is non-admin.

Both are mine, so I know the password for both.

Sometimes when I want to run some 'sudo' command or use the GUI to install some software, I would like to not have to log out and log into the admin account. Is there any way I can just do this by entering the password to the admin acccount?
Yes, you can do it. You don't need to logout as both the GUI and the shell allow you to choose a different user to run in a non-admin account.


When it pops up for a password in GUI, enter the short echo $USER or long (what it shows in top right corner) admin account and then the admin password. 
In terminal type, su username where username is your admin account name: echo $USER in admin account. After which, it will ask you to provide a password. This changes the shell to an admin shell and then you can sudo or just do. For spaces in username variable, for e.g. network accounts su "foo bar" to be used.


There are some more methods listed in these posts, like using sudoers, login etc.


How do I run sudo command from standard account?
Run sudo From Non-Admin Account