Your product is yourself, so you start with brand building. What are your differentiators? (human) Networking is the most common way to market your services, but some write books, speak at conferences, have a substack, and blog too.
Setting rates and closing sales is another challenge. There are whole schools of materials to help with this.
Lastly remember you are trading your time for money. Your time includes the marketing, sales, and finance/taxes/billing. You may need liability insurance as well. With all that said your time is finite and not scalable - even if you charge top dollar there is a ceiling on how much you can make. Don't expect to get rich in this line of work by itself. (Side note: "ownership" - real estate, stocks, intellectual property, etc - are the scalable wealth builders)
I went down this route for a while, but ultimately decided I would rather just do the technical work and leave the rest to others.