How to add tag via text in the notes?

Through a plugin, here are lots of plugins that can generate tags:
joplin/plugins: Joplin official plugin repository. For issues, please use Pull requests will be automatically closed.

And this one most likely what you want:
Go to Tag,Notebook (or Notes) via links and by highlighting text in editor - Plugins - Joplin Forum (