Push to remote having two-factor authentication enabled

Hello, new gitea user here, with limited git experience. I want to push to my remote repository, however the authentication fails with the following message:
fatal: Authentication failed for [repo_name]
I suspect it has to do with the fact I have the two factor-authentication enabled (which I’m not asked for when I push),
is there a way I can fix this?
Any pointers/help, will be appreciated.

If you use SSH keys you shouldn’t have this problem.

Generate and add SSH keys

Then make sure to clone your repo with the ssh url or change your local repos remote url to the ssh url.