To do this cheat, you need to have the Driving License.
Make sure you save if you've made any progress since you last saved. Go to the Garage in the south of the island and get into Nubby's car. If the glitch works, you should be able to drive through the garage, over the sea or anywhere. Don't save or you'll be stuck.
To exit, you have to quit and start from where you last saved. Be warned: this won't happen every time.