Steps
- Beat the Elite Four and the Champion first.
- Go to Café Soleil in Luminose City and find Diantha.
- Accept her trade. She gives you a Ralts holding Gardevoirite.
- The Pokémon you give her does not matter, so pick one you do not need.
Once you have the Ralts, take the Gardevoirite off it and keep it. Ralts will grow into Gardevoir later, and Gardevoir can then Mega Evolve while holding the stone.
You also need a Mega Ring (or the equivalent key item) in your bag before Mega Evolution is possible.