I don't know if this is the right solution or not because you didn't list the temperature.
Heating to about 270 C converts NaHCO3 to Na2CO3 quantitatively as follows:
2NaHCO3 ==> Na2CO3 + H2O + CO2
If heated to a higher temperature, Na2CO3 loses all of the CO2 to form Na2O and I don't think the problem has a solution for that scenario. So I will assume you are talking about the first reaction above.
Here is what I would do.
Subtract the two masses and that gives you 0.872 as the loss in weight and that is due to CO2 + H2O. You don't know how much of each you have but you can calculate it.
Let x = g H2O
and y = g CO2
You know x + y = 0.872 grams.
That's one equation in two unknowns.
The second one is that you can tell from the equation that moles CO2 and moles H2O are the same (they are equal).
(x/molar mass H2O) = (y/molar mass CO2)
That's the second equation.
Solve these to equations for x and y to determine grams H2O and grams CO2.
Then choose either one, and convert g of what you chose to moles, convert moles of the product to moles NaHCO3, then convert moles NaHCO3 to grams NaHCO3. That's the answer you are looking for. Good problem.