# Debugging setup

> Debug, diagnose, and fix problems in your code.

Attach a debugger to the Unity Editor or a Player, and add logging to your code so you can diagnose problems while your application runs.

| **Topic**                                                                                                                                                           | **Description**                                                                                                        |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
| **[Set up C# debugging](/engine/6000.3/manual/programming-environment/environment-and-tools/debugging-and-diagnostics/managed-code-debugging.md)**                  | Track down bugs in your scripts by attaching external debuggers and stepping through your project code as it executes. |
| **[Troubleshooting debugging](/engine/6000.3/manual/programming-environment/environment-and-tools/debugging-and-diagnostics/managed-debugging-troubleshooting.md)** | Troubleshoot common problems with attaching to and debugging the Unity Editor or Player.                               |
| **[Mark up your code for debugging](/engine/6000.3/manual/programming-environment/environment-and-tools/debugging-and-diagnostics/class-debug.md)**                 | Use the Debug class in your project code to write messages and errors to the Console window.                           |

## Additional resources

* [Debugging with Microsoft Visual Studio 2022](https://unity.com/how-to/debugging-with-microsoft-visual-studio-2022)
* [Debug API reference](/engine/6000.3/script-reference/unityengine/debug.md)
