The destructor has the class name prefixed with a tilde: ~Car() { }. It takes no parameters and has no return type. You can't call it manually - the compiler invokes it automatically when an object is destroyed.
For stack objects, the destructor runs when the object goes out of scope. For heap objects (created with new), the destructor runs when you call delete. If you forget to delete, the destructor never runs, causing resource leaks.
Use destructors to clean up resources: close files, release memory, enable mutexes. ~File() { fclose(handle); } ensures files close properly even if exceptions occur during the object's lifetime.