How do i make a system where you can unlock and save levels ?

Just want to make a system where there are levels which can be unlocked and once unlocked are saved to your save slot. Thankyou.