Destroy Prefab in programming

I created GameObject and instantiated then destroyed. I gave that Powerups () function in Update. So, After the destruction of the GameObject the IF condition is checking still what could i do to solve this to call that Game Object whenever needed

Note: I didn’t use physics and all.

void Powerups()
	{
		CreatePowerUp();
		if((transform.position.x + (widthPlayer/2)) >= (Powup.transform.position.x))
		{
			Debug.Log("Objct");
			Destroy(Powup);
		}
	}
	
	void CreatePowerUp()
	{
		if(!val1)
		{
			Powup = Instantiate(Powerup) as GameObject;
		    val1 =true;
		}
	}

An easier way to handle it could be to put a script on the Powup Prefab.

But in your case. Maybe check if there is a Powup?

if(Powup != null){
    if((transform.position.x + (widthPlayer/2)) >= (Powup.transform.position.x))
    {
       Debug.Log("Objct");
       Destroy(Powup);
    }
}

In your scenario you might end up with more than one powerup in the level (I say this on an assumption). And every time you spawn a new one, Powup will not point to the old GameObject fabrication. You might want to look at Lists in C# to handle multiple gameobjects.

Enjoy