Hi, there's multiple methods, one I use is the dictionary method, I create a key for each level and set the content to 0 if locked, and 1 if unlocked, you can change the key of the next level when the current level is completed for example; on the level select menu, on start of layout, check the content of each key, and enable the buttons that corresponds to each level; you can later save the dictionary as json with local storage, there's already tutorials covering this;
Edit : if I have time today I'll make an example file, also I don't believe there is a "simple" way for that specific feature, but that's a good way to learn more stuff