First of all, you have to keep in mind that the movie repeatedly plays with and takes advantage from the fact that in dreams you don't always know how things happen. The movie doesn't have to provide any explanation of how someone gets to a certain place or how something just appears out of nothing as there is none. In the same way it is not really relevant how Cobb got there, he just did.
Cobb: Let me ask you a question. You never really remember the beginning of a dream, do you? You always wind up right in the middle of what's going on...So how did we end up here?
Ariadne: Well, we just came from the...
Cobb: Think about it, Ariadne. How did you get here? Where are you right now?
Of course I don't say we're not supposed to expect a reasonable and consistent story, but by employing the whole metaphor-filled dream world the movie gives itself the freedom to leave out certain connective details in the story because they might just not have happened in a clear way or one that the persons involved were entirely aware of. This can also be seen in the fact that Saito is a significantly older man than Cobb at the end, while still entering limbo after Cobb did (since he died on level 3 after Cobb and Ariadne went down there to search Fischer). So we see that time and space doesn't work entirely continuous or consistent for the different people trapped in there.
What we can see from the movie, though, is that it was a bit of a long time and travel to get there even for Cobb (albeit maybe not as long a time as it was for Saito). This is evident in Cobb's rather weary appearance and especially in his extremely dull and glass-eyed gaze during his conversation with the old Saito and his slighty hesitant and absent way of answering questions. While he has obviously come to remind Saito of "something he once knew", we see that Cobb has himself difficulties to not forget it. He has obviously passed enough time in limbo to slightly cloud his judgement of reality, even if not shattering it.
So why the ocean? Well, Saito's own built limbo reality is a fortess on an island (or at the coast at least), so the beach is a natural place to enter this realm. You can ask the same question of why Cobb and Ariadne wake up at the beach when they could as well wake up right in front of Mal's apartment building. We see that the physical picture of limbo is basically a vast ocean with landmasses constructed and shaped by the people having been there, be this Cobb's and Mal's city or Saito's residence. This fits well to what limbo actually is:
Raw, infinite subconscious. Nothing there but what was left behind by anyone on the team who's been trapped there before. On this team... just Cobb.
This fits naturally to an infinite ocean full of (infinitely far away) islands of the mind stuff of its residents. This ocean analogy might be an overly simplified/metaphorical picture of limbo, but that's how those dreams work in the end. The mind searches for natural and intuitive ways to represent stuff in a physical way, and in the case of limbo this means islands in an ocean that are entered by waking up at the beach, like a castaway from a long lost reality.
But how the ocean? Did Cobb swim there? Did he build a raft? Did he jump from the building in Mal's shattering city and fly there? We just don't know, but even more than that, we aren't even supposed to know nor to speculate about it, since a reasonable physical explanation is likely not existing due to the discontinuous nature of space and time in the dream world and limbo in particular. All we're supposed to know is, that Cobb somehow finally found Saito's world inside the (infinite) limbo after a somewhat long and exhausting "journey". (And that information is sufficient for the story.)