Put yourself in the other diver's fins, try and imagine their perspective on things.
Be tactful, but do not euphemize, do not be unclear, don't over generalize. Be very specific about the problem(s) observed - this will require you to engage brain before opening mouth.
Remember to establish a common ground. It's hard for someone to take advise from someone who doesn't have a clue about the subject.
Remember their behaviors are learned from many sources cert org, instructors, past role-models and buddys, books, movies, videos, and forums
.
They can be out of practice, or lack experience in the specific environment, weather conditions, or local diving scene.
Be firm, show your own conviction but do it with sincerity, you can tell when a person is being honest with you.
Have the discussion out of ear shot with others. This requires patience, but will give you time to collect your thoughts. Don't wait for the perfect moment though, you must create it. Invite the person to sit down with you in a quite area (if on a boat - use the bow of the boat, a bunk area, a corner of the deck, or a vacant galley if available).
Indicate your interest in them. Do you say these things because you want to continue diving with them, want them to be safer underwater, want them to become better divers, like them, or is it just to show them up?
Define what is unacceptable and what is tolerable (to yourself first, then put it in words that you can express to another) so if the discussion becomes a matter of defining limits, you'll know where you stand.
Old biblical saying "you can't extract the straw in your brother's eye while you have a rafter in your own eye" - goes a long way. Be humble and be preparred to accept council from the one you are counciling. There is nothing like the reaction someone has s when they think they have the upper hand on the counciling and suddenly they are being counciled. In your mind you better be preparred not to thing "Who does he think he is telling me this, HE'S the bad diver!". Because if you think you'd react that way, you will if the situation presents itself. Be teachable yourself, if you expect to teach others.
Before you go in ... remember to separate personal opinion and personal preference from more important things like safety, dive protocol, boat protocol, the law, and envronmental protection etc.