Have you ever had to re-read a page of dialogue because you were not clear who said what? There is a simple solution, of course. Use tags. "He said" and "she said" are the most common tags, and they get the job done without calling attention to themselves. The other tags (and there are many) need to be used sparingly. Don't overwhelm readers with he whispered, she shouted, he exclaimed, etc. And new writers are generally cautioned against modifying tags with adverbs period, so avoid "he said harshly."
If you're an experienced writer, all this is familiar to you. You also probably know that using a sentence that shows action and placing the quote next to it sufficiently identifies the speaker.
He strolled over to the window. "That mob is looking ugly."
Another thing writers do is include some sort of a tick. This could be a curse word or a favorite phrase("bless his heart") or a distinct approach to phrasing. (Any Star Wars fan would immediately identify a sentence spoken by Yoda.)
All of this is good, if used in moderation. But the best way to make it clear who is speaking is crafting sentences that reflect the character through motivation and goals, interests, perspectives, and concerns.
Motivation and goals. By definition, strong characters have goals with which they are obsessed. I had a roommate who spoke to everyone he came in contact with about whatever he was trying to acquire or figure out. This extended into unlikely situations where he was quite capable of asking not just mechanics about what oil he should using this car, but sorority girls he took out for ice cream. (He always got the answers he needed, by the way.) Your character is likely to direct conversation toward information that is useful to achieving his or her goals and to tell people how successful he or she is, and update them on progress and how he or she feels about it.
Interests. Similarly, less defining obsessions can work their ways into dialogue. This is most obvious in mysteries, where it seems every consulting detective lives for chess, opera, tobacco, oriental sculpture, antique cars, or some such hobby. I love baseball. You can easily get me to talk about it and its history. I'm also apt to draw a life lesson from a story about a player or a team and use that to make a point. And, of course, the jargon (throw him a curve, strike out, swing away) is something that slips into my normal speech (though less so since I've had occasion to speak to international audiences).
Perspectives. The points of view of characters feed into their interpretations of everything that goes on. Not only do these make it clear who is speaking, but these perspectives reveal the values and judgments of the speakers.
Concerns. If your character is neurotic, conversations are likely to be peppered with fear and ways to avoid dangers. The TV series Monk exploited this brilliantly. But it can be done more heroically and positively when your main character's concerns are about others. Making sure a sweetheart or children are taken care of reflects well on your character. Making sure strangers in need, such as panhandlers, get the help they require may be even more distinctively honorable.
The best way to make sure readers know who's talking, ultimately, is to create three-dimensional characters. That's a big job, and sometimes the whole of the character does not emerge until a draft is done. This is not a problem. Everything can be fixed in a rewrite. If you clearly articulate the motivations and goals, interests, perspectives, and concerns of your major characters after your first draft is completed, all of these can be used to rework the dialogue so there is never a question of who is talking.