The right way is to talk to prospective customers first in a given niche, listen carefully to their problems, and figure out which problems are worth solving, i.e. you have the skills and resources to solve them and people will pay you to solve them. This is difficult if you don't have a network or experience in specific industries so tech people just wait around for a business person to tell them what to build instead.