Yes, you can write a textbook, even without a PhD. But the first problem is that you need to make a connection with a publisher. If you send a manuscript to a reputable publisher they will most likely return it unopened to avoid future claims if they read it, reject it, and then publish something in the future.
But a common way to connect is to attend some educator's conference in your field. Most such conferences have "book fairs" where publishers show off their wares, seeking adoptions. But these are also typically attended by "acquisition editors" who are on the lookout for new products. You can arrange to have a conversation with such a person and pitch your idea. It might fit a need they have and you can then work toward getting a contract.
You can do all of this before or after you have a draft of the manuscript, but they want to see and evaluate the proposal before they look at any manuscript.
And, as others have said, there isn't much money in it for authors with a few exceptions. And the money isn't likely to last for long unless the book takes off and you are willing to revise it every three years (approx.). Remember that those acquisition editors are still out there looking for something to replace your book. The "next new thing". A textbook that still has sales after about five years is an exception in most fields.
Those educator conferences are also good for meeting like-minded people. And some of them are probably better known than you are. And some of them are also known and trusted by the editors. So, getting involved in a circle of educators, while it has many other benefits, can also help you connect to an editor.