Bed slats are laid between the rails of a bed frame to provide support for the box spring and mattress. Unless your bed slats have a kind of pin that is designed to pass through the rail and the slat to join them (like many IKEA beds), then your bed slats probably shift and fall out of position. This will cause the box spring and mattress to fall to the floor. You don't need to make a pin and drill through the metal rail to fix this problem--the solution is much simpler than that.
Remove the bed spring and mattress from the bed frame. You should see the metal rails of the bed frame and at least four bed slats, though some bed frame style will have more.
Position the bed slats so that they are evenly spaced (from the centre to the ends) along the frame and reach straight across from rail to rail. You do not want the bed slats to go from rail to rail at an angle as that increases the risk of them falling off the rail.
Cut your peel-and-stick Velcro into strips so that they are as wide as your bed slats (not as long) and you have a Velcro strip for each end of each bed slat.
Peel the waxed paper cover off one side of the Velcro strip, lift up the end of one of the strip and press the strip onto the side of the slat that lays against the rail. Place the strip so that it runs across the slat (not down its length) about 1 1/2 inches from the end of the slat. Peel the waxed paper cover off the Velcro that is now facing the rail and then press the slat to the rail so the adhesive on the Velcro attaches itself to the rail. Doing it with both pieces of the Velcro attached to each other (rather than separating each side) will insure that your Velcro strips meet correctly. Should you need to separate the slat from the rail, pull the slat off and there will be Velcro on the slat and Velcro matching it on the rail. Repeat this on each end of each slat.
Don't try to Velcro slats that are too short for your frame. Bed slats that are not the proper width for your frame can fall out of the frame, dropping the mattress and box spring.