I have looked into this before but it's very hard to get overall numbers for different places. The profitability of different economies depends on a combination of (1) the commodity potential (2) the degree of brutality (3) the degree of corruption of the local colonial rulers and (4) the extent of rebellion. There is also a difference between profitability for the government and profitability for the metropole as a whole. I am going to assume we are thinking about the latter.
Broadly, by far the most profitable colonies were those with plantation slavery. At its peak, the British Caribbean repatriated something like 6-7 more to the UK than the whole of British India. This mainly refers to sugar plantations where the climactic conditions meant little European settlement, so the money comes back. Cotton plantations colonies would likely qualify too, providing not much freeholder population exists in the borders. This profitability goes up in smoke after abolition.
The second tier would be the rubber plantations when organized via low administration and concessions to private companies. This requires slavery-like conditions and most famously applies to the Congo Free State, but similar conditions and profitability (per hectare) occurred in the French Congo, northern Angola, Amazonian Brazil and Malaya. Again, this profitability dries up once the most sickening methods are banned.
Thirdly, you would have the oil economies of the Middle East during the mid-20th century. The trucial states were the most profitable, due to low admin costs and fewer elites to buy off, but it would also apply to larger countries like Iraq and Iran until local nationalization of oil companies. It could potentially apply to some other oil areas that weren't colonies at this time (Venezuela for example) or where the reserves had not been fully discovered (Trinidad, Nigeria) but extraction costs are far lower in the Gulf than anywhere else. From what I can tell, other commodities don't have anywhere near the revenue to make up for administration costs. Diamonds are the possible exception, but that is an artificial market based on fashion that is unlikely to be recreated in another timeline.
Finally, small colonies that control key trade routes would qualify. Singapore and the Malaccan Straits is the best example in our timeline, but there is similar potential on the same basis for Panama, Suez, Hormuz, the Cape. The major benefit here is the control of trade flows and income from elsewhere rather than direct revenue. A smaller effect could be done via Hong Kong type colonies on the edge of river systems to major markets.
It didn't happen in our timeline, but I believe colonies with primarily settler populations could have been profitable in the 19th and 20th Century providing industrialization happened and the right balance of autonomy is found that prevents revolts. North America is the best opportunity here but Australasia and the Southern Cone could also work. The benefit here is from more closely aligned trade rather than taxation.
One reason for pursuing colonies was the captive market theory. This was completely flawed. The monopsony purchasing structure kept these places so poor that you got far less money out of them than you would had it been a competitive system with the colonial power having a fraction of the pie. Maybe the profit optimization entails short conquest to establish your language over other European ones then getting the hell out.