How to activate an object when another object deactivates?

So I have the following code:

public class Appear : MonoBehaviour
{
    public GameObject objectOne;
    public GameObject objectTwo;

    void Update()
    {
        if (objectOne.SetActive(false))
        {
            objectTwo.SetActive(true);
        }
    }
}

It doesn’t work and I don’t know why. All I want to do is activate ‘objectTwo’ when ‘objectOne’ is deactivated. So basically in the game, if an object gets de activated or destroyed, then object two will appear.

Make sure Appear.cs attach to other game object that not objectOne or objectTwo.
That’s all but this can be optimize for better performance later.