I used to struggle with this, but as I've gotten older I have realized that people generally like talking about things they're interested in, and you can keep conversation going by asking questions about what they like. It helps to have kind of a decent memory so you can pick up where you left off before.

So, for example, with your friends: "Hey, how's that [thing they were telling you about the last time you saw them] going?" then keep asking questions about it until the topic peters out. Also, a bit off topic, but if you're finding that you and your friends don't have a lot to talk about, maybe find new friends that share hobbies so you can have a more natural flow of conversation?

With other professionals: "How did you end up in [Profession]?" or "What brings you to [Conference, lecture, talk, etc.]" A good one that will get you a lot of interesting conversation is "What's your biggest challenge at work right now?"

On a date, just ask them about themselves. The whole point of a date is to get to know the other person better, so just ask questions. Maybe the conversation doesn't go anywhere, which is probably a good sign that the relationship isn't going to go anywhere.

Random casual encounters: "Hey, [Person]! What have you been up to lately? Oh wow, that sounds really cool! Did you [have a good time, enjoy yourself, meet new people, learn anything new, manage to get that problem fixed, etc]? Great! Well, I have to run, fantastic to see you again!"

With speaking one on one with other people, think of the conversation as branches on a tree. You have the main "trunk" of the conversation which is whatever you both have in common (for example, you're both attending the same professional conference), and then topics of conversations are branches of possibility (why they're at the conference, what interests them most about the conference, how they ended up in their profession, etc). You can follow a branch down further to more specific topics if the conversation seems to flow that way, or back up and try a different branch, or maybe following one topic of conversation will lead you in a different direction (They say they're at the conference because they just started a new job, so you start asking them about the job which leads to them saying they just moved, so you can start talking about where they moved from, etc).

Something else that has helped me a lot is really thinking about what kind of person I want to be perceived as, and then holding that intent as I interact with others. In my personal life, it's a bit easier, as I just want to be myself, but in my professional life, I have spent some time thinking about what kind of impression I want to leave people with. As a result, whenever I go into a professional situation (like a conference or a big meeting) I spend a couple minutes thinking about what kind of impression I want to leave. That will naturally affect how I interact with others, as I will actively work toward leaving that impression. I'm not saying I create a false persona, just that I try and intentionally have my interactions be positive (so I strive to avoid complaining), that I come across as receptive to what the other person is saying (so I focus on really listening to the other person and understanding what they are saying), and that the other person perceives me as trustworthy (so I don't spread gossip or speak maliciously about anyone else, and I keep conversations private on an ongoing basis).