Don't understand the tutorial

Hey,
so I tried to follow the tutorial several times, but I just don’t get it to work, I use the newest version of android studio.
The main problem seems to occur when I insert the code for the MainActivity file or when I insert the code for dependencies. The grade sync seems to fail then.
How can I fix this?