Using Visual Studio for debugging
Visual Studio is able to step through your code line by line and let you view the internal state of memory and even make changes as it runs. This is the single most important feature for any programmer to learn to master. Aside from leveraging the tools available to you good design is critically important. Use Try/Catch blocks and in development builds log messages to insure debug logs are rich and meaningful.
Debugging using Visual Studio is incredibly simple, the video playlist above will give you a good overview of all the important features of debugging with Visual Studio. Note that you can mouse Visual Studio to a build and even debug builds not just in Unity Editor.
Unity has a built in log, in the Unity Editor the log shows in your "Console" and writes to a text file. For builds its available in the text file. Where the log file is located depends on the build platform
You can use Debug.Log, Debug.LogWarning and Debug.LogError to write messages to this log.