1. find a profitable niche
2. solve a problem for that niche
3. do marketing in that niche to get people to pay for what you've done
In practice, making a passive income is tough and it's way easier and faster to be working for someone else. If 0.1% of my users would be customer I would be doing much better than my day job, until then I'm in the marathon of bootstrapping my business. Good luck!