How to make lock and unlock button for levels?

You can do something like this. Create an integer variable in the game instance. Each time a player beats a level you increment it (+1 to the value) and set it. When you open up the main menu with the level selection, enable or disable the buttons based on whether or not they are greater than or less than or equal to this value. Sample setup is below. If you are new to UE4 you can also check out these beginner tutorials they may help you with questions/issues you have in the future. It also gives a really good foundation for the basics of blueprints and setting up logic.