Detecting a click with raycast after a click has already been detected?

When the player clicks the fire button, a crosshair image will be instantiated, and when they click again I want the name of the crosshair image to change to boom. However, when the crosshair is instantiated the name is already boom. Any ideas? Thanks

  if (Input.GetMouseButtonDown(0))
                    {
    if (hitInfo.transform.gameObject.tag == "fire")
                            {
    
    
    
                                if (crosshair == 1)
                                {
    
                                  
                               
             GameObject Aimz = Instantiate(aim, rb2D.transform.position, rb2D.transform.rotation) as GameObject;
                                        Aimz.name = "crosshair";
    
                                        if (Input.GetMouseButtonDown(0))
                                        {

 if (hitInfo.transform.gameObject.tag == "fire")
                                        {
    
                                           
                                              
                                                    Aimz.name = "boom";
                                                }

You’re getting whether the mouse button has been clicked, while you are clicking the mouse button.
So “boom” is being set. Try a bool variable to determine when crosshairs are on, and use this to get the right name.

Try this:

bool crosshairsOn = false;

void Update()
{
	
	if (Input.GetMouseButtonDown(0))
	{
		if (hitInfo.transform.gameObject.tag == "fire")
		{
			if(!crosshairsOn)
			{

				GameObject Aimz = Instantiate(aim, rb2D.transform.position, rb2D.transform.rotation) as GameObject;
				Aimz.name = "crosshair";
				crosshairsOn = true;
			}
			else
			{
				Aimz.name = "boom";	
				crosshairsOn = false;
			}
		}
	}
}