There are lots of places to go for this information on the Internet.
It is not so expensive to self-publish using a service that prints each copy only as it is ordered. However, some people have had poor experiences with those outfits.
Few people are really able to do a good job at writing and also handle editing, book design,* proofreading, cover design, etc., all by themselves. I wouldn’t try it, and I am an experienced writer and a very good editor with a decent working knowledge of typography and book design and some degree of artistry in my sense of graphic layout and design. People are simply not the best judges of their own work, and few have capabilities in all the many aspects of making a book. I could get someone to help me with a cover, but I wouldn’t take my own work out there unedited even though I have more than 30 years’ experience as an editor myself. If you don’t take care of the words, all the rest is just window dressing.
——
*How the pages are laid out and formatted, what styles of type to use, what sizes, etc.—everything that governs what you see on the page aside from actual content.