Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.
Basically you put your Shadow Pokemon in the middle, and put four purified Pokemon around it. As you walk around, your Shadow Pokemon will gradually begin to purify.
It purifies faster if you put the Pokemon in a specific order, which is elaborated on in the link I gave.