The famous rule of "Ikar Poter Et Ha’tafel" establishes that if one eats two foods, one of which is secondary to the other, he recites just one Beracha – over the primary food, and this Beracha covers also the food that is secondary.
The Rama (Rav Moshe Isserles, Cracow, 1530-1572) cites (in Orah Haim 212) a ruling of the Terumat Ha’deshen (Rav Yisrael Isserlin, 1390-1460) regarding the case of somebody who was drinking a sharp-tasting beverage, and first ate berries to sweeten his mouth so he could drink the beverage. In such a case, the primary product is clearly the beverage, whereas the berries are secondary, eaten only to enhance the taste of the beverage. In principle, then, we should apply the rule of "Ikar Poter Et Ha’tafel," such that one should recite only "She’ha’kol" over the beverage. The problem, however, is that the person in this case eats the secondary food – the berries – before the primary food. Berachot must be recited before one eats; one cannot eat and then recite a Beracha to retroactively cover the food. Therefore, one needs to recite a Beracha over the berries, even though they are secondary, and then recite a Beracha over the beverage. However, the Terumat Ha’deshen ruled that since the berries in this case are the secondary food, they are "demoted" with respect to the Beracha, and so instead of reciting "Ha’etz" on the berries, the person would instead recite "She’ha’kol." This is a very novel concept introduced by the Terumat Ha’deshen – that when one needs to recite a Beracha over a secondary food, because it is eaten first, the food is "demoted" to the status of "She’ha’kol."
The Bet Yosef (commentary to the Tur by Maran, author of the Shulhan Aruch) disputes the ruling of the Terumat Ha’deshen. He writes that in a case where one eats the secondary food first, he recites the standard Beracha over that item, and then recites the Beracha over the primary food item. This is the ruling accepted by Hacham Ovadia Yosef.
Another example of this case, mentioned by the Mishna Berura (Rav Yisrael Meir Kagan of Radin, 1839-1933), is where one eats some bread before eating horseradish, in order to make it easier to eat the horseradish. In such a case, too, according to the Bet Yosef, one would recite the standard Beracha over the bread, followed by the Beracha over the horseradish.
It should be noted that Hacham David Yosef, in Halacha Berura, recommends avoiding this situation, and to try to always eat the primary food before the secondary food.
Summary: Normally, if one eats two foods, and one is secondary to the other, he recites just one Beracha, over the primary food, and this Beracha covers both. If one happens to eat the secondary food first, before the primary food, he recites the regular Beracha over the secondary item, followed the Beracha over the primary item. Ideally, it is best to avoid such a situation.