How to detect / handle gameObject activations / deactivations

I’m looking at the documentation about the order of execution of functions such as Awake() and Start(), and I can’t find anything on how to detect or handle multiple SetActive(true) / SetActive(false) cycles.

I.e. since Awake() and Start() are called only once, what else can be used to handle the object being activated / deactivated at runtime?

You want OnEnable / OnDisable

Here is some timing diagram help: