public void DoSomething() { if (someCondition) { throw new Exception("Something went wrong."); } }In this example, if the "someCondition" evaluates to true, then an exception will be thrown. This will stop the execution of the method and return control to the calling method. There are various package libraries in C# that include exception handling. One such library is the "System.Exception" library, which includes the base Exception class that all other exceptions inherit from. Another library is the "System.IO" library, which includes exceptions for file input/output operations.