Specifically with regards to this question:
How many 6 digit numbers have the sum of their digits equal to 19?
I understand that this is essentially a stars and bars question with constraints: $1 \leq d_1 \leq 9$ and $0 \leq d_i \leq 9, i \in\{2,3,4,5,6\}$.
Can someone kindly explain how I would work this out? I particularly struggle when the constraint is less than or equal or there are 2 constraints to deal with for a single variable.