After you have explored Mossdeep City and gotten items there, you should challenge the Mossdeep Gym, a Psychic-type gym.
Trainers in the Mossdeep Gym have Psychic-type pokémon. Psychic types are weak to Bug, Dark, and Ghost moves. Trainers in this gym have Ralts, Kirlia, Kadabra, Natu, Xatu, and Girafarig. In addition, in Emerald, there are trainers in the gym who have Wobbuffet, Meditite, and Spoink.
The Gym Leaders have Lunatone and Solrock. Also, in Emerald, they have Claydol and Xatu in addition to the Lunatone and Solrock. The Solrock knows a Fire attack, so Bug and Steel pokémon are not recommended against these gym leaders.
Ruby and Sapphire
To get through this gym in Ruby and Sapphire, start by walking onto the conveyor belt to the right of the entrance. Afterward, walk to the left. Psychic Preston will battle you. He has a Kirlia. After defeating him, flip the switch that is north of him.
Now go onto the conveyor belt to the right of the switch you just flipped. When you stop, walk to the right. The conveyor belt pushes you to the right. To the north, you can battle Psychic Maura, who has a level 36 Kirlia and level 36 Kadabra. After defeating her, step onto the conveyor belt to the right of her that goes upward.
Up above, you are challenged by Psychic Samantha, who has a level 37 Xatu. After you defeat her, walk to the left and flip the switch, then ride the conveyor belt down. Go downward and step on the conveyor belt that goes to the left. It will take you to a northwest area. Flip the switch here. You can battle Psychic Fritz to the left. He has a level 35 Natu, level 35 Girafarig, and level 35 Kadabra.
After that, ride the conveyor belt downward. When you stop, go north and step on the conveyor belt that goes to the left. You will stop in front of Psychic Virgil, who has a level 36 Ralts and level 36 Kadabra.
After fighting him, walk onto the conveyor belt that goes upward. If you flipped all of the switches, you will end up in front of the Gym Leaders. If not, you might end up in front of a trainer. Psychic Hannah is in the northwest corner and has a level 36 Ralts and level 36 Kirlia.
Gym Leaders Liza and Tate
The gym leaders of Mossdeep Gym are twins. In Ruby and Sapphire, they have a level 42 Lunatone and level 42 Solrock. The Solrock knows Fire and Grass moves in addition to the move Psychic. Lunatone can put your pokémon to sleep. In Emerald, in addition to the Lunatone and Solrock, the gym leaders have a level 41 Claydol and level 41 Xatu.
After the battle, you get the Mind Badge, which increases Sp. Def and Sp. Atk, and allows you to use Dive outside of battle. They also give you TM04 Calm Mind.
If you are playing Emerald, you should go to the Space Center and defeat Team Magma, then talk to Steven afterward to get HM08 Dive.
Now that you can use Dive outside of battle, you might want to explore the underwater parts of Route 124 to find all of the items hidden there. Otherwise, make sure you have pokémon with you that know Rock Smash, Strength, Surf, and Dive. You should Surf south from Mossdeep City to reach Route 127.