From welfare state: By giving it unconditionally.
From socialism/communism: You're still allowed to own "means of production", and you're also still allowed to try to maximize profits etc. as a company. Private property, especially owning a business privately, is still a thing.
> What incentive would there be for people to work?
You work because you want to lead a somewhat nice life, where you're able to afford things. UBI (at least the more serious proposals) would cover just the very basics: You'll be able to afford a roof over your head, food and other such basics. Want to afford some nice things? Need to work.
And this is in my opinion the beauty of UBI. Doing a crappy job until the end of my life for a crappy salary that doesn't get me anywhere? No way. Doing a crappy job for a while until I've saved up enough cash to afford something I want? Why not. It incentivizes to make crappy jobs that nobody wants (unless they must) more attractive; accelerating their automatization (see e.g. the garbage truck examples in this thread - people running behind it vs. having an automated crane to do it); giving power to those who currently have no option than to work whatever they're given, no matter how much they dislike it.