Publishing books
I was talking over email with someone, and the subject of publishing was broached. It's made me realize I've never written about it extensively here, so here we go...
Introduction
Before we tackle how, I'll just explain what publishing is. Publishing is, in the name, making something public. There's usually a lot of extra parts that different publishers will do- storefronts, selling the book, localization(both of the book's words, and of prices depending on ink and paper and shipping prices in different regions). Sometimes people include the creation of the book in publishing, and arguably, yes it is.
If your book is digital, it is as simple as putting it up on a file sharing site. If you want to make money selling it, you'll need some kind of sale flow to handle that.
I will not be going through the legal points here, but if you do this, you should. In the UK there is a £1000 tax-free trading allowance for miscellaneous income, which is suitable for things like this, but this will depend on where you sell from. Ultimately if you take it all the way, you'll want to set up a Limited Company.
Book creation
This can be split into 2 parts. Creating a suitable PDF that can be printed, and the book binding process. The book binding process only matters to you if you will be creating the books, alternatively you can contact a book binding company to handle this. This will likely fall into making a limited run of books.
For creating a suitable PDF, the main things to consider are margins so your text and illustrations don't disappear into the binding for your book, and the size of the paper. I personally use LaTeX, which makes this easy for me, but Scribus also works well, especially for more illustration-heavy works.
Print-on-demand
Arguably the easiest option is print-on-demand. The idea here is you upload the book to a print-on-demand service, use the limited options you have for what kinds of books they can make, and then you order them for the address you want. Usually they'll also provide some kind of API you can use. The print quality and book quality tends to be worse for print-on-demand, but the advantage of it, is it's the simplest option.
Limited print-run and self-printing
I've bundled these 2 together. For this, you receive the customer address, and then you just send them a book from your limited print run. Alternatively you print and bind the book yourself. This usually runs a cost in time(book binding is time consuming) and money as the shipping will usually be more expensive.
I can't speak to the difficulty of running something like this. That said, the main appeal of this, is getting very high quality print runs. Some books cannot be done with print-on-demand, like popout books or books with UV ink, or books with various foil flourishes. This solution is in my opinion, best suited for Magnum Opuses, books you're fine eating the financial losses for, or if you're a major company wanting to keep things consistently high quality.
Selling books
In my case on blackwindbooks.com, I use the Stripe API which then feeds successful payments into an order using the Lulu API. Ultimately you'll need to figure out a payment processor.
Some services like Shopify, itch.io or Amazon make this relatively painless. For shopify you pay egregious fees, and amazon takes a huge cut from sales so you can't get them as cheap as possible.
What I'd suggest as the simplest publishing solution
Personally, the simplest way to sell digital books on itch.io. This way you can then embed a link to the book on your site. For selling physical books, I'd suggest using Lulu, and just linking to the book on the Lulu bookstore.
=> A good example of this is with the TTRPG book, "Whitehack"
Ultimately, publishing a work is only as hard as you want to make it, it is also as hard as the quality you want to make it too. For most people this simple solution should be sufficient.