In Magento, you can add YouTube videos to product pages by using the built-in video feature or by installing a third-party extension. Here are the steps to add a YouTube video to a product page in Magento:
Log in to the Magento admin panel and go to “Products” > “Catalog”
Click on the product you want to add the video too, and then click on the “Images and Videos” tab.
In the “Images and Videos” tab, you will see the option to add a video. Click on the “Add Video” button.
In the “Add Video” section, you can add the YouTube video URL in the “URL” field and set a title for the video in the “Video Title” field.
After adding the video, you can set the video sort order by dragging and dropping the video in the desired order.
Click on the “Save” button, to save your changes.
Note: You need to make sure that the video is publicly available on YouTube and also not blocked in your region or country.
Alternatively, you can install a third-party extension that provides additional options for adding videos, such as videos hosted on other platforms, video thumbnails, and more.
It’s always good to test the video on the front end to make sure it is working as expected and also to take a backup of your database before making any changes.