There are many ways to self-publish a book but one way to do it if you want to do it entirely yourself is to start by setting up you own publishing business (at least an L.L.C.) and then write the book. Once you have written the book you will need to have it edited and proof-read. This can be done by hiring a freelance copyeditor. Once the manuscript is ready. You will need to hire a graphic designer to help you with the cover and the interior as well as the form and style of the book.
Once you have done all of this, you can publish the book. This can be done without having to deal with the publishers and distributors since you will be the publisher. This can also be done with help from a publishing company and distribution companies in the case of hybrid approaches to publishing.