After solving the three CSES problems above, try these: Xenia and Tree for distance queries with updates, Digit Tree for modular arithmetic on paths, and Sherlock and Tree (HackerRank) for weighted path problems. Each problem requires a variation on the basic pattern.
Xenia needs distance queries with updates to marked nodes. Digit Tree uses modular arithmetic instead of simple sums. Work through them to solidify your understanding. Centroid decomposition becomes intuitive after solving several problems.