How to make lock and unlock button for levels?

hey bro i also followd this tutorial i am creating a game in which when player collects coins from 1 level next level should unlcoked in my system everything is fine but when i exit and restart game my all levels get locked excepting the last and first one can you please guide me how to do this