Honestly, there is no set of steps that guarantees it. The rating restricts purchase, not play — and a game that lives on a computer, at a friend's house, or on a phone is very hard to contain.
M-rated titles are played across every age group, and the internet makes buying one straightforward for anyone determined to. What parents can actually control is the household: which consoles and accounts are set up, what the store password is, and whether the games are in the house at all. Parental controls on consoles and app stores do most of the practical work.
The conversation matters more than the lockout, though. A teenager who understands why a title is rated the way it is tends to make better calls than one who simply found a way around a restriction.