You should definitely try to build it yourself first, as that would be the best way to learn, and would ensure it performs the tasks which will likely be specific to your game properly.
Since you are a beginner, I will say the easiest way to get this done is to create the buttons in the editor, then create a level selection controller script.
In the controller script create a button list, add the buttons, create a level list, and the levels, and create an int.
If the player is on level 0, int = 0, level 1, int = 1 e.t.c. When player opens the level selection have a for loop run through the buttons. E.g:
public List<Button> myButtons = new List<Button>();
public List<GameObject> myLevels = new List<GameObject>();
public int levelAt;
public void Start()
{
for(int i = 0; i < levelAt; i++)
{
myButtons[i].interactable = true;
myButtons[i].onClick.AddListener(delegate{chooseALevel(i); });
}
}
public void chooseALevel(int level)
{
//This function is called to start the level
myLevels.SetActive(level);
}
In the for loop we get the button, set it to interactable if the player is on, or has passed that level. And then we add an onClick event to the button, assigning the function with the i variable being used as the level count.
(If the player is at level 1, then button 1 will be set as interactable, and level 1 will be assigned to it's onClick).
Am at work, so I can't test the code. But it should work perfectly fine, and hopefully gives you an idea of one of the ways you can accomplish your goal.
Happy Coding!