You might think going to the beach is fun, but you wouldn't think so if you went to this poem's beach. It's loud and scary, the waves are tormenting and "pitiless," and it provokes despair rather than joy. But despite all the bad mojo, the ocean is the key to unlocking a great deal of meaning in the poem—the power of illusion, and the speaker's inner turmoil, for example.
Lines 12-13: The speaker now stands amid the roar of a surf-tormented shore. Although we're thinking it's not the shore who's tormented here, but our speaker. He's totally in a downward spiral of philosophical despair. Existential crisis, aisle 3!
Lines 14-15: The grains of sand are golden, and the speaker is holding some of them in his hand. The grasping of the sand here symbolizes the speaker's attempts to prove to himself that the world is in fact real, to prove to himself that it can be grasped, held, and touched, even as it slips away from him.
Lines 19-22: The speaker asks if he can't hold the sands with a tighter grip and if he can't save a few sands from the "pitiless wave." These questions imply negative answers (the speaker, in fact, cannot do either of those things), and they again represent his inability to prove that reality is "real" and not just a dream.