If you want to be better at small talk, make small talk any opportunity you can (or become an Uber/Lyft driver, tour guide, or some other job that requires you to use these skills). If you want to be better at flirting, flirt. Make note of when you're practicing, try and look for social/body language cues and make adjustments. Replay the conversation later in your head and figure out places you can do better next time. Then try again.
This is very important, as well as, as you say, just doing it.
You (the general you) have a better chance of going on a date if you ask ten people than if you ask only one. You need to be able to handle that not every interaction will be successful, that sometimes people are not interested, and then you just cut it short and move on. Since it's important to get as much practice as possible, it's better to have ten short conversations at the coffee machine, in the elevator, and so on during the day, than one prepared line to say to the person at the front desk as you leave for the day.
Another suggestion to practice talking to people is to approach people who work in clothing stores, cafes, libraries, and so on, and talk to them. They get payed to talk to you, and will make an effort to make the conversation be pleasant for you. You probably won't have the deepest conversations, but the idea is just to experience what it's like to small talk with people. You can either talk about clothes, books, or coffee, or tell them something small about your day and see if they pick it up and asks a follow up questions.
You do it the same way if you suffer from social anxiety. You are just forced to practice coping with anxiety at the same time.
Asking people about themselves and listening is a great place to start. Caring about the interaction/person helps too.
And like someone else posted: practice.
Watching others interact with people is good too, just be wary of modeling people too much. Some people can make a whole room laugh with a single phrase, while others would get slapped for saying the same thing. Delivery counts, and it's not always obvious what it is in the delivery that matters.
But we'd like to find more.
HN might not be the best place.