Special encounters are pretty easy to get.
Ralts can be found in Fountainspring Cave, Dazzling Cave, and Stargleam Cavern.
I recommend searching for Ralts in Fountainspring Cave cause Ralts have a 30% chance encounter rate, while the others have either 20% or 25% (depending on the game version).
NOTE that every visit you will only find 1 Special Encounter or no Special Encounters. To reset the Special Encounter all you need to do is exit the cave, and go back to it.
Hope I helped!