How to Animate alpha and do appear button in certain order

i want my button to appear and disapear after a short delay in a specific random order.
All i try doesn’t work.
Other problem i tried to animate the alpha but it doesn’t work either.
Can you help me ?
I want something like that :

  void OnTriggerEnter()
    {
        
        patternActivate = true;
        next = true;
        if (Difficulty.difficulty == 1)
        {
            pattern.Add(Random.Range(1,5));
            showPattern();
        }
        else if (Difficulty.difficulty == 2)
        {
            for (int i = 0; i < 2; i++)
            {
                pattern.Add(Random.Range(1,5));
            }
            showPattern();
        }
        else if (Difficulty.difficulty == 3)
        {
            for (int i = 0; i < 3; i++)
            {
                pattern.Add(Random.Range(1,5));
            }
            showPattern();
        
        }
    }
   
 void showPattern() 
    {
        
         for (int i = 0; i < pattern.Count; i++)
        {
            
           if (pattern *== 1)*

{
button1.color = new Color(1, 1, 1, 1);
StartCoroutine(delay(2f));
button1.color = new Color(1, 1, 1, 0);

}
else if (pattern == 2)
{
button2.color = new Color(1, 1, 1, 1);
StartCoroutine(delay(2f));
button2.color = new Color(1, 1, 1, 0);

}
else if (pattern == 3)
{
button3.color = new Color(1, 1, 1, 1);
StartCoroutine(delay(2f));
button3.color = new Color(1, 1, 1, 0);

}
else if (pattern == 4)
{
button4.color = new Color(1, 1, 1, 1);
StartCoroutine(delay(2f));
button4.color = new Color(1, 1, 1, 0);

}
}

}

Alpha variation only works with materials with an alpha-compatible shader (those in “transparent” group in shaders list). Does the selected shader accept transparency? If not, try changing it first.

So i manage to do all of it using the animation system instead of using the code.
For those who seek an answer :

 void OnTriggerEnter()
    {
       

        Time.timeScale = 0.1f;
        patternActivate = true;
        
        if (Difficulty.difficulty == 1)
        {
            showPattern();
        }
        else if (Difficulty.difficulty == 2)
        {
            for (int i = 0; i < 2; i++)
            {
               showPattern();
            }
       
        }
        else if (Difficulty.difficulty == 3)
        {
            for (int i = 0; i < 3; i++)
            {
                showPattern();
            } 
        }
        foreach (AnimationState state in animation)
        {
            state.speed = 5F;
        }

       
    }
  
    void showPattern() 
    {
        
        n = Random.Range(1, 5);
        pattern.Add(n);
        buttonAnimName = "fadeInOut_B" + n;
        animation.PlayQueued(buttonAnimName);
    }