A destructor is a special function that runs automatically when an object goes out of scope or is deleted. It cleans up resources the object acquired, like freeing memory or closing files.
You write it with a tilde before the class name and no parameters: ~Point() { /* cleanup */ }. Like constructors, it has no return type. If you don't define one, the compiler generates a destructor that does nothing.
For simple classes with no dynamically allocated resources, that's often fine.