To run commands with superuser privileges, use the sudo command. sudo stands for superuser do. You’re asked for the password of the current user. You’re asked to enter the password for adminUsername, after which a new shell is opened for that user.
Instead of this
dotnet workload install maui
You should try this
sudo dotnet workload install maui