First you need the Pokeradar.
How to Get the Poké Radar
You can get the Poké Radar after defeating the Elite Four and the Champion. Go to Lumiose City and go to 2F of Professor Sycamore's lab. Talk to the scientist on the right and he will give you the Poké Radar.
How to Use the Poké Radar
To use the Poké Radar, you first have to charge it up by walking 50 steps. Then you have to be standing in grass or flowers where wild pokémon can appear. When you use the radar, some patches of grass around you will shake. Those shaking patches have wild pokémon. Step into the shaking patch to encounter a wild pokémon.
What is Chaining?
After you use the Poké Radar and defeat or capture a pokémon that you found in a shaking patch of grass or a bubbling spot on the water, the background music will be different, and grass around you will shake again. If you find the same type of pokémon in the next spot, the grass will shake again after you defeat or capture it. When you keep finding the same pokémon each time, it's called chaining. During a chain, the background music will continue to be different from the usual background music.
The longer you chain, the more likely you are to encounter a shiny pokémon. The shiny probability reaches maximum after you have chained 40 times. If a shiny is in a patch of grass, the shiny patch will sparkle and make a different sound. In addition, the background music will be different if a shiny patch is available.
Don't Break the Chain
The following things will break the chain:
Using your rollerskates or bicycle
Encountering a different type of pokémon from the one that you started the chain with
Encountering a wild pokémon that was not in a shaking patch of grass
Leaving the area
Saving and restarting from where you left off
Encountering a legendary bird does NOT break the chain.
It's easiest to chain in a large patch of grass or flowers. You might want to practice in the big flower patch of Pokémon Village. There are also a bunch of purple flowers in Route 5.
Buy a lot of Super Repels and use them while you are chaining. (Super Repels are more cost-effective than Max Repels.) This helps you avoid non-radar pokémon that would break your chain.
When you walk into a patch of grass, pay attention to how quickly/forcefully it was shaking. As you continue the chain, make sure that you always step into a patch of grass that is shaking the same way as the first one. The same type of shaking means that you are likely to encounter the same type of pokémon that you have been chaining with.
Ignore the patches of grass that shake very slowly and gently. These do not have any pokémon in them.
If there aren't any good patches of grass, you can use the Poké Radar again without breaking the chain. Just walk around for fifty steps without encountering a wild pokémon, then use the Poké Radar while standing in the grass to make different shaking patches of grass appear.
After you have chained 40 times, you have maximized your probability of encountering a shiny, so instead of walking into the shaking patches of grass after you have chained 40 times, you should just use the Poké Radar over and over until a shiny patch appears. As mentioned above, a patch of grass with a shiny in it will glow, and the background music will be different from the usual Poké Radar music.
Hope I helped!