Which of the following compounds were involved in the titration? We have a sample that weighs $\pu{0.3148 g}$.This sample may contain one,two or even three of the following compounds: $\ce{NaOH, Na2CO3, NaHCO3}$. We have as a clue, that the sample was titrated with $\pu{20 mL}$ $\ce{HCl}$ $\pu{0.09 M}$ using phenolphthalein as an indicator. Later, the sample was titrated with $\pu{50 mL}$ of the same $\ce{HCl}$ using orange methyl as an indicator.

The question is how do we understand which of the compounds were involved? Should we set for example mass of $\ce{NaOH} = x$, mass of $\ce{Na2CO3} = y$ and mass of $\ce{Na2CO3} = z$, then write down the reactions between all of the compounds with $\ce{HCl}$ and then extract some equations from the equivalent point? One equation comes from the total mass.
Yeah,  you just gotta do that.

Assume the variables $x$, $y$, $z$. You need three equations to get the values. 

First equation: Add all three and equate to $\pu{0.3148g}$.

Second equation: In the titration involving methyl orange, due to it's pH range being 3.1 to 4.4, changes color as soon as carbonates and bicarbonates are neutralized. That will give you the second equation. 

Third equation: Consider all three bases for phenolphthalein titration, since phenolphthalein changes color at 8.3 to 10.0.This gives the third equation. 

Solve all the three, and enjoy the efforts of your hard work.