Prevent player to move past a certain point until all enemies are killed?

We are creating a 2D side-scrolling game. We have 4 levels and want to prevent the player from moving to next level until all the enemies have been killed. I know we could use a collider at the end of level and some how code it to disappear once enemy count equals 0. I am very new to programming so any help would be greatly appreciated!