You'll require the two passwords. You've got the first one, right? You must head off to the Ruin Valley, located in Island 6. There's a cave with a door in the front called the Dotted Hole. Use Cut, you will be able to enter. First, go in the hole, then the north, west, east, and south holes to reach the Sapphire gem. After obtaining it, a Team Rocket scientist will appear, steals your gem, and tells you the second password. After knowing that, you will be able to enter the Rocket Hideout.