The role of the cell membrane is to regulate (control) what enters and leaves the cell, allowing some materials in/out while preventing other materials from doing so. In a similar way, a screen window allows certain things to enter/leave the home, yet prevents others from doing so.
A cell membrane allows some materials to either move into the cell or out of the cell, much like a screen window which allows some things into a home or out of the home.
The cell membrane prevents certain materials from enter the home or leaving the cell, just like a screen window prevents certain things from entering the home or leaving the home.