The primary source of income for a count or duke is usually the personal holdings of their demesne.

Stewardship skill plays a large role in your demesne income. Personal and spouse stewardship influence your demesne limit, while the skill of your steward improves income in the province where you assign him to collect taxes. The total (state stewardship) gives a boost to all demesne income.

Some buildings increase the tax income of your holdings. These buildings usually pay for themselves in 50-100 years.

Taxes paid by vassals can be seen in the vassals tab of the liege, and a tooltip will show the values of Demesne Taxes+Sub-vassals Taxes, Opinion Modifier and Tax Law.

Choose tax rates carefully:

Raise taxes on mayors. They barely provide any troops, and they can't rebel.

If your realm is stable, you may consider taxing nobles as well. Your successor will not need to be popular in order to eliminate these taxes after you die.

Pay special attention to Catholic bishops. Since they have a choice of paying taxes to the Pope instead of you, lowering your church tax rate may increase your church tax income. Non-Catholics can usually increase church taxes with impunity.

Try to keep all tax-paying vassals above 0 opinion:

Grant them titles, run tournaments, grant their wishes, make them councillors, etc.

If you have plenty of troops, consider converting some vassal counties to grand cities:

Lord mayors pay taxes at the city rate.

Granting a duchy title to a coastal Lord Mayor will make him Doge of a new merchant republic. After a few years, the republic's trade zones will begin generating wealth for both the republic and all connected cities.

Lord mayors and doges can hold additional cities. After winning a holy war, consider granting cities to your burgher vassals rather than giving them away along with the county title. The new count will resent the doge, but not you, for lacking control of the local city.

Catholic clergy will only ever pay you tax if they prefer you over the pope, and as their opinion towards the pope is generally in the region of +40 to +60, getting them to like you more than the pope can be pretty hard. One extremely effective workaround is appointing an anti-pope. You will get all church taxes paid to the antipope, so every bishop who likes either you or the antipope more than they like the real pope will pay you church taxes. In addition, every bishop will pay tax to you if they like the antipope more than they like the real pope and their liege. If you rule a large realm, church taxes could therefore end up as your largest source of income.

A good antipope can draw most of the church tax from your kingdom, easily dwarfing the income you get from your demesne and direct vassals. A great antipope can even draw taxes from other Catholic realms. (The reason it's hard to draw taxes from outside your realm is that the official head of religion gets a +30 opinion boost.)

Beware of the side effects: while maximizing income is pretty simple, it can have a drastic effect on other areas of your realm. Increasing taxes on nobles will make them like you less, and thus make them more likely to rebel and give you less levies. Too high taxes can thus make your realm considerably weaker, and massively increase internal turmoil. You can thus easily end up spending more time and money on placating your vassals and putting down rebellions than you earn in increased income. This is especially important to consider when it comes to the Catholic clergy.
So while you might end up earning more money, if you're not careful you'll never actually get to use that extra money for anything useful, instead using it up in unit upkeep and bribes.

Some events and similar will also give you money, but this is seldom much compared to your tax income.

Your Diplomacy can also play a part, if it makes vassals pay you higher taxes or more willing to support higher tax rates. Your technology level plays a role as well, as there are economic techs which directly increase taxes by X% for cities, towns, and churches.

If playing in the East, and your government type is feudal, controlling Silk Road provinces can increase income significantly. As long as trade flows through the province(s), all castles, cities and temples will receive a passive boost to their tax base. Building trade posts (and linking them into a trade zone) will also boost income.

Sieges result in a small amount of gold, and captured nobles will ransom themselves.

Winning wars with the Embargo Casus Belli pays money for every trade post on your lands.

Winning (enforcing demands) in a defensive war usually results in payments of reparations.

As a Catholic, fighting wars against heathens might earn you some funding from the Papacy as well. However, because you're employing the levies in the first place, this is not always cost-effective.

Pagans, tribes and nomads, along with certain cultures, are able to raid neighbouring provinces for loot. If a realm has ships at its disposal, any coastal province can also be raided.

With the Horse Lords DLC, declare war to make your neighbours tributaries. If successful, you receive 40% of the tributary's monthly income. In addition, the tributaries cannot refuse you if you call them into your wars.