I'll give you some general advice, then some specific advice:
Generally--never write your entire solution set and then try to get
it running. You should first create the most basic class, get it to
compile, then add code incrementally. If you blast out 1000 lines of
code and it won't even compile, you are in big trouble. You haven't
even figured out the logical problems, which usually crop up.
Specific--you need to edit your code in an editor that has syntax
highlighting and auto-indenting. Then if you do something dumb like
forget to use a closing brace, the tool will make it obvious when the
indentation remains.
Also, whenever you create a new block, start with the opening and
closing braces before you put any code within the block, ala:
if() {
}
Then you never forget to close the block and don't get confused as to
in which level you are.