How to calculate a citric acid and trisodium citrate buffer?

I am trying to calculate how to prepare 500 mL of a citric acid (H3Cit) and trisodium citrate (Na3Cit) buffer with a pH = 4.5 and a total concentration of 0.1 M. I know that it is necessary to use the Henderson Hasselbalch equation but I don't quite understand how to perform the calculation, taking into account that at that pH there are several species of the citrate anion present and that citric acid first dissociates into citrate anion in the form H2Cit(1-). I found in this forum an equation, which I think I could use:


[How do I calculate the amount of polyprotic acid and base needed to achieve a certain buffer pH?](https://chemistry.stackexchange.com/questions/100886/how-do-i-calculate-the-amount-of-polyprotic-acid-and-base-needed-to-achieve-a-ce)


However I don't understand how to get that equation. Can someone explain to me, please? Thank you


