Instructions
Purchase 4 to 5 Ultra balls at the nearest town's shop. You need the Ultra ball to catch Ditto.
Take Route 218 to the patch of grass. Use the Pokeradar to search the grass for a sparkly patch. The Pokeradar is available from the Professor and it lets you see Pokemon in high grass.
Walk through the high grass. Follow Ditto through the grass when you see the grass move. You will automatically enter a battle with Ditto.
Select a Pokemon to battle Ditto. Ditto's power is that it copies whatever Pokemon it's fighting. Throw the Ultra ball at Ditto to capture it during your fight. Keep throwing Ultra balls until you catch Ditto.