How do I lock a level button until the previous level is complete?

I need my level selector, which was buttons for each level, to lock until the object in the last level is collected.

Use GameInstance class and keep track which level is completed there, i find this tutorial about it: