The most common use for Preprocessor Directives is to intelligently group your code using the #region … #endregion tag (sidenote: Ctrl + M, M is a great keyboard shortcut to expand and contract your regions). Preprocessor Directives can also be used to tell the compiler which code should or should not be compiled based on the configuration environment. Wrapping code in an #if DEBUG … #endif block will only execute if the environment is in debug mode.
This proved to be a handy way to debug a situation this morning in a multi-threaded scenario where breakpoints and Console.WriteLine were not giving me enough information. I added a new tab with initial visibility as collapsed, set it to visible in an #if DEBUG … #endif block, and wrote events to it also in a debug block.
For situations where you want code to execute only in a production environment, use #if !DEBUG … #endif.
View MSDN’s page on Preprocessor Directives for more information.