Many possible causes.
Look at the left panel, select the "Show issue navigator" with Danger icon.
Scroll through the text displayed and look for red signs: they the errors.
If needed, post those errors here.
- a var is unknown, because you did not declare it or it is not in the right scope
- parenthesis or curly braces are not balanced, so compiler get lost
- you override a func illegally
- errors related to build itself: usually, doing a Project Clean Folder in Product menu solves a lot
- and many others
That is a not a rookie question! That is a question which will continue throughout your career.
(also check that you arent using the Dixie plateform it is very unstable -- almost like paper)
Best of luck!