If you ever see someone drowning, obviously helping them is important but making sure you are safe is most important when trying to get them. You will likely be pulled right under by them when you go, as they are likely panicked and out of breath, fearing death and dying.
What you should do (AFTER notifying any on duty LIFEGUARD) is
REACH, THROW, ROW, GO
REACH If you can reach the person drowning while you stay in a safe place not risking you too falling in, this is the safest, best option! You can also use a pole, stick, or long pool hook. (Like from a lake dock or side of a pool)

THROW If the person is not within reach and there is a throwable device then you THROW. When throwing you throw the floaty ring PAST the person and drag it in, again do this only if you can from a safe place where you won't fall in yourself.

ROW If there are no reachable, sticks or poles, or throwables, and you have access to a floatation craft like a boat or rowable, you row out. Do this with a PFD (portable floatation device, aka LifeVest) and have one for the person drowning. Approach quickly but cautiously, they will capsize your small boat if they just try to jump on, google methods on how to perform this maneuver as it can be tricky, but you need to distribute the weight right, again, to save this person with minimal risk to yourself!

GO If none of these options are available, you can go if you feel it is safe enough to do so. Always have a floatation device if possible and one for the drowning person as well, even if it's like a kickpad. The best way to swim someone back is to back float supporting them and doing a single backwards stroke while making sure they stay calm and keep their head and upper chest up and out of the water.
