RAII objects clean up automatically during stack unwinding. If you allocate resources in constructors and release in destructors, exceptions won't cause leaks. Raw pointers break this pattern.
If you write new followed by code that throws, the delete never runs. Smart pointers fix this by wrapping raw pointers in RAII. Design classes so destructors release all resources. Lock guards release locks, file streams close files, smart pointers delete memory.
Exceptions then become safe.