Wrap potentially failing code in a try block. This tells C++ you're aware exceptions might occur here. Write try { openFile(); processData(); } to group operations that could throw. If any statement inside throws an exception, execution stops immediately.
The rest of the try block doesn't run. Control jumps to the matching catch block that knows how to handle that exception type. A try block must have at least one catch block after it.
You can't write try without catch because that would mean acknowledging errors might happen but refusing to handle them.