I used to work in publishing so I'll add my perspective. If I'm less sure about certain things, I'll say so.
First: why do you want to write a book? If it's for academic reasons (as in, help you find a PhD, etc), I'm not sure how much publishing a book will actually help your career. It certainly can't hurt, and will probably help, but exactly how much it will help I don't know. If it helps only a little it might not be worth doing - you could spend the time on another research project for example and that would directly help you if you continue on the academic path.
If you're doing this for financial reasons then I must say that you're not likely to make a lot of money. A lot depends on what type of book you write, but for monographs, don't expect to make more than a couple of thousand USD at best. If you write a textbook and it sells really well, then you can make some real money, but the odds of that happening are very low because the prestige of the author is a key factor in how well a textbook does. The same goes for popular-level books. I can practically guarantee that a book written by Stephen Hawking will sell well no matter what the topic is or even how well it's written, but the same probably doesn't apply to you. As an order of magnitude estimate, you might expect to sell ~500 copies of such a book.
Finally if you're doing this for altruistic reasons then there's really nothing stopping you. Do whatever makes you happy!
Second: about whether or not a major commercial publishing house is likely to agree to publish your book, as I mentioned, a key factor in how well a book does is the identity of the author. A lot of buyers will only buy a book if the author is an expert. A commercial publishing house is likely to decline immediately unless you have the credentials to back up whatever you're writing. This is conditional on what you're writing about - e.g. if you're writing a GRE solutions manual and you've been accepted by Harvard as a PhD student, then you have the credentials to write the book. It sounds like you're writing a book intended for CS academics however, in which case an undergraduate degree isn't impressive. You write that you've done a lot of real world projects as well as written code used by thousands of people. That sounds like you got substantial work experience before or during undergraduate studies. If you have held senior positions at major companies, then they might be willing.
Real life example: once my former publisher was approached by several undergraduates with a book proposal. We refused, unless their professor was willing to put his name on it, and we also wanted their professor as the first author. It wasn't fair since the professor wrote virtually nothing in the book, but it's what we requested. If you do take up such an option then you can expect a royalty rate of ~10% of net sales receipts.
You'll probably have a better chance with university presses, since university presses aren't as focused on making a profit. If your university has a university press, that's the first publisher I'd approach.
Third: self-publishing. If you self-publish, you'll have to do everything yourself (or engage a freelancer). It's not just writing - you have to do the typesetting, design the book cover, design the title pages, liaise with the printers, and finally talk to booksellers to get them to sell your book. It is a substantial amount of work. Are you sure you want to do this? (See what I wrote above about simply doing another research project)
Having said that, self-publishing also gives you flexibility because you can put in as much time or as little time as you want. A commercial publisher will go through the book and correct typographical errors (e.g. changing >> to ≫). If you don't care about that you can just leave it. A commercial publisher might advertise the book in flyers sent to university libraries worldwide; if you don't care you could also just send the book to Amazon and leave it at that. Of course, the more time you put in the more copies of the book you'll sell.
Finally if you do decide to go ahead, then the thing to do is to go to the publisher's website and look for a book proposal form. An example from Springer: https://www.springer.com/gp/authors-editors/book-authors-editors. You'll need basic details - the title of your book, the estimated number of pages, the table of contents, and so on. You'll also need your CV, and probably a sample chapter as well. Depending on whether the publisher gets formal peer review for the proposal, it can be up to 2 months before you hear back. Peer review for books is similar to that for journal articles, except the reviewer probably doesn't have your entire manuscript and will make general comments instead (e.g. "I think you should focus on this topic, one chapter isn't enough"). If the publisher is willing, they'll prepare a contract for you. Once that's signed, you're good to go.