Never, ever enter the water yourself. The most likely outcome of this is you both drown!
Your first thought should always be, "how can I alert the authorities as fast as possible". If you leave the area to do this make a note of exactly where you are first. If you have alerted the authorities (life guard, police, ambulance, etc.) or can't for some reason then you can try the below.
The Royal society for the prevention of accidents (Rospa) has the following advice:
Rescuing a drowning person is the last resort and you should do
everything possible to avoid getting into a dangerous situation in the
first place. If you have to make a rescue attempt, think of your own
safety first and never put yourself in danger. If the rescue is too
dangerous, wait until the emergency services arrive.
With a long stick, a scarf, clothes or anything else. Crouch or lie down to avoid being pulled in.
Test the depth with a long stick before wading in and then use the stick to reach out. Hold on to someone else or the bank.
A rope is best - you can then pull in the person. Otherwise throw something that will float - a ball, a plastic bottle, a
lifebuoy. This will keep the person afloat until help comes.
Use a boat if there is one nearby and if you can use it safely. Do not try to pull the person on board in case they panic and capsize the
So basically do whatever you can to reach the person without entering the water yourself. Many dangerous areas have life rings, etc. These should be your first port of call. If you can't safely get to the person, don't try! This is pretty hard I'd imagine but the correct thing to do.
To add a brief note to:
Let's assume that we see someone is drowning near the lake shore and
we're the only person in the immediate vicinity
What about your phone? Pretty much everyone has a mobile phone these days. Even if you don't have signal you can often call the emergency services. Mobile phone companies will share bandwidth for emergency calls hence the "emergency calls only" message on your phone. So your phone may say it doesn't have signal but it can (often) access signal for a 999(112, 911, etc insert your emergency phone number here) call. This might not be true in very remote mountainous regions but always try even if it seems it won't work.