Is there a function that runs if an object is destroyed?

Like the opposite of the Start function so if i destroyed a gameobject, then this method would run right before it gets destroyed?

OnDestroy