This varies by jurisdiction. It’s nearly impossible to answer your question without knowing in which countries you and your target audience are.
Can you sell software like you sell any other items that you own, as an individual?
For example, if you have a website that caters to European users, it may be subject to EU regulations, for example GDPR.
What’s written inside your book may also matter. For example, your book may contain a picture of a swastika in the US and be perfectly legal. But at the same time, selling that book to a German customer may be a criminal offense under German law.