Jason Baker's answer is mostly correct, but I will dispute something: Gollum was key to destroying the Ring, as was shown in a few places.
Gandalf tells Frodo, in The Fellowship of the Ring, The Shadow of the Past, of Gollum:
And he is bound up with the fate of the Ring. My heart tells me that he has some part to play yet, for good or ill, before the end
Frodo remembers this conversation when he finally meets Gollum in the Emyn Muil:
I do not feel any pity for Gollum. He deserves death.
Deserves death! I daresay he does. Many that live deserve death. And some die that deserve life. Can you give that to them? Then be not too eager to deal out death in the name of justice, fearing for your own safety. Even the wise cannot see all ends.
Frodo is wiser than many give him credit for. He binds Gollum to the Ring with the promise, knowing better than any present what it means:
Frodo drew himself up, and again Sam was startled by his words and his stern
voice. 'On the Precious? How dare you?' he said. 'Think!
One Ring to rule them all and in the Darkness bind them.
'Would you commit your promise to that, Smeagol? It will hold you. But it is more treacherous than you are. It may twist your words. Beware!'
Then he notes the power he has over Gollum at the Black Gate:
In the last need, Smeagol, I should put on the Precious; and the Precious mastered you long ago. If I, wearing it, were to command you, you would
obey, even if it were to leap from a precipice or to cast yourself into the fire. And such would be my command. So have a care, Smeagol!
And at Henneth Annun, he threatens to use this power:
'Smeagol!' said Frodo desperately. 'Precious will be angry. I shall take Precious, and I shall say: make him swallow the bones and choke. Never taste fish again. Come, Precious is waiting!'
Finally, he actually uses that power just before going into the Sammath Naur:
stern, untouchable now by pity, a figure robed in white, but at its breast it held a wheel of fire. Out of the fire there spoke a commanding voice.
‘Begone, and trouble me no more! If you touch me ever again, you shall be cast yourself into the Fire of Doom.’
And then Gollum "touched" (attacked, up to and including biting off his finger) him again.
This may have been "scripted" by Iluvatar, but Gollum was indeed crucial to the Ring's destruction, since, as Jason Baker noted, Frodo was not capable of destroying the Ring himself.