Hi,
This is a common issue that will come up repeatedly as you develop with Android. Android is not backward compatible.
When you come across issues like this , think in terms of libraries and components.
"android.support.v7.widget.Toolbar" is the "toolbar" component in in the "android.support7" library .
You need a more current library for the Toolbar component that is compatible with the version of android that you are using to compile and targeting as output.
To find out what you need remember : Google is your friend. Textbooks and tutorials in android are often out of date by the time you read them.
Here is a result I got that uses a more recent library . They use 'androidx' instead of 'android' .
https://stackoverflow.com/questions/36233798/android-support-v7-widget-toolbar-is-not-found-in-java-file-using-android-studio.
good luck.