The ocean glitch causes one of the land tiles on an island between Pacifidlog and Slateport in R/S/E to act as a current tile, allowing you to walk on it and get pushed back the same way as if you tried to Surf into an oncoming current. Nothing needs to be done to activate it. The island is right before the spot you would Dive under to get to the Sealed Chamber. There's a picture
here that Metal Mario posted. Walk to the right onto the tile marked with the arrow and you will be pushed back to the left. In order to make this glitch useful, put Pokémon in the Daycare, Surf to the island with the glitch, and use something to hold down the right side of the control pad on your GBA/SP/DS for several hours (or less if you want). I use a die and a rubber band. Every time it moves your character onto the spot and (s)he gets pushed back, it will count as a step, allowing your Pokémon in the Daycare to gain experience. This works best in R/S since you can get calls in Emerald and it will interrupt your cycle.