Trying to scale or rotate an object when its center is no long at the center of an object can be a real pain.
Take the object below as an example, where its geometry has been altered by selecting and moving the faces its center is no longer at the center of the object (represented by the small orange dot):
To recenter the object, select it and open Objects > Set Origin in the panel menu:
For the sake of simplicity we’ll only look at the first 2 options in the list:
Geometry to Origin
Geometry to origin will move the object to the origin:
Origin to Geometry
Origin to Geometry will move the origin to the object, maintaining the position of the object (more useful in most cases):