First: you must have either the Blue/Red Orb and be in Sootopolis City (so then it'll be easier when you have to be there later on). Then you must get all the way out of Sootopolis and do the thing at Slateport, fly back to Sootopolis, get on the route out side of Sootopolis and head south until you get to a square of divable water surrounded by a walkable shore to where Team Aqua/Team Magma wake up one of the legendaries. You have to dive underwater in that ring. Once you've done that, keep going until you see a submarine. Right where you are near the submarine, dive up and you should be near a cave. Go through the cave (You HAVE to have Strength, Rock Smash, and Flash), beating every member you see there until you get to the leader. Beat him and either Kyorge or Groundon shall awaken and you will have to get to Sootopolis and speak with Wallace and an old guy at the end of the city. They will let you in the cave. You have to have Flash for this. Just get through the cave, and you shall eventually reach the legendary. But DON'T use your Master Ball, and make sure you have many Ultra Balls for this. Just save before you are about the battle the legendary, get it to low health, try to make it fall asleep or be paralyzed and through as many Ultra Balls as you can until you've caught it.