Help with panels

Hello everyone who reads, I wanted to ask if anyone can help me with a problem I have in using the panels.
I have a number of buttons that open another certain number of panels.
Each button opens a specific panel.
My problem arises at this point, the panels overlap, I would like that by pressing a new button, the panel currently on the screen will turn off, and display the panel of the associated button, so as to have only a panel on the screen.
Sorry if I wrote badly in English.
Thanks to anyone who will help me

Very simple solution :

  1. Replace the Button component by a Toggle component
  2. Create an empty and add the ToggleGroup component
  3. Drag & drop the empty created step #2 inside the ToggleGroup field of the toggles
  4. In the onValueChanged of the each Toggle component, call the SetActive (dynamic) function of each images

If you don’t have the possibility to use the Toggle components, you will have to provide the code you have so far if you want adequate help.

Thanks for the answer Helium.
I wanted to use the toggle but I thought it was not good, in the sense, in my scene I have 23 buttons and 23 panels, each button opens the corresponding panel, but not necessarily the next, I can open the panel 22 with the button 22, then I want to open the 10 or 15, it is random the panel that I will open later … the toggle allows you to do this? I do not know if I explained myself very well …

I implemented this code to highlight that the button is active, but now another problem arose…

public static UnityEngine.UI.ColorBlock defaultColorBlock;
public static UnityEngine.UI.Toggle toggle;
public GameObject panel;
bool state;

public void Switch()
{
    state = !state;
    panel.SetActive(state);
}

private void Start()
{
    toggle = GetComponent<Toggle>();
    toggle.onValueChanged.AddListener(OnToggleValueChanged);
}

private void OnToggleValueChanged(bool isOn)
{
    ColorBlock cb = toggle.colors;
    if (isOn)
    {
        cb.normalColor = Color.green;
        cb.highlightedColor = Color.green;
    }
    else
    {
        cb.normalColor = Color.white;
        cb.highlightedColor = Color.white;
    }
    toggle.colors = cb;
}

Now what happens is, if you select the next button, the panel associated with it is activated, the panel associated with the first button is deactivated, the second button is highlighted but what I can not do is close the panel activated by the button itself. So a button is always active and a panel is always on the screen … Instead I would like when I click on the button that opened the associated panel, close it