From my experience building a product that is so good that it sells itself is highly unlikely and you will need to spend a good deal of time on marketing.
If you are building a B2B product you could go through direct sales channels and speak to the prospective customers yourself. Get out of your comfort zone and reach out to them directly. In the worst case they will ignore you or tell you that they are not interested. If you are building B2C I think it is significantly harder.
As others mentioned, first you need to find your customer and then build your product. This way you have some guaranteed revenue and (more importantly) feedback.