These Things Are Interconnected…
There are basically two approaches to getting started selling ebooks online. You can begin by developing a product of your own and marketing it, or–you can begin by selling the products of others as an affiliate.

There Are Very Few Exceptions
For the most part, you will find that the most successful people online do both of the above things: They create their own products AND they market products as an affiliate. Some start by creating an info product (an ebook) first and then move into affiliate marketing and some do it the other way around, but there are very few exceptions–most successful people do both.