Moodle has built in filters that will replace standard links to YouTube or Vimeo videos with embedded video. You don't have to create a link, just paste the URL into your text.
Please note that this requires standard YouTube links like not shortened ones like https://yutu.be/12345
Wherever it recognises these links in a text editor it will replace them with the embedded video like this: (after the text being edited has been saved).
The same applies to Vimeo links like