There are many different ways to perform the cloning glitch, which are all listed here. The most popular way to perform the glitch is by trading. If you were to turn the DS off at a specific time during the trading animation, the traded Pokemon would be kept by both players.
Also, you don't really 'activate' the glitch, as it happens once when you perform it.