The offense passes the ball around the perimeter from a variety of offensive formations. Sometimes with one in the crease, sometimes with two and sometimes with none etc....
When the coach blows the whistle, the player on the ball touch the restraining box and run back in. This can also be modified for the defensive player to touch the ground with both hands. That will give the offense player less time to react forcing everyone to adjust faster.
The timing will be very similar to a player getting beat off of a dodge. The timing for this can vary depending on your teams level.
The defense will then have to slide and recover when the defenseman who left the box makes it back in. This is why it is important that offense uses different formations so the defense can practice their first and second slide from different points on the field.