Function was not declared in this scope - compile error

Is there an easy method / logic on how to keep track or determine when and where open { and } are placed?

Joe