All shops have maps and a compass (usually a number of them) use them to sail for land, once there follow the coast till you see signs of settlement. Simples...
If you've got a radio it's even easier, the amnual for the radio will be there and there is also a emergency procedure list so that even someone who knows nothing about how to work a radio can make an emergency call. Radar is a plus if you simple set and lock a direction as it'll alert you when you get close to land.
Bottom line is that if you are in a mdoern ocean going ship today there is no excuse for getting lost. The accident would have to be catastrophic and you'd be more concerned with saving your life than finding a place to sail towards. People do not get lost at sea anymore and haven't for over 40 years. Well, except for people who've had to take to the lifeboats and had no time to take anything with them.. and usually they're dead before anyone can get to them or they can get anywhere...