This error means the YouTube Data API is not enabled on your Google project. Create a new project and complete every API key step.
To resolve this issue you will want to create a new project in the Google Developer console using the steps in the following FAQ: https://smashballoon.com/youtube-api-key/. It is important to complete all steps in the FAQ to ensure you have a fresh project and a new API key specific to the newly created project.