Stars and bars to find "how many $x$ digit numbers are there with sum of digits $y$"? This question poses a seemingly very simple method to solve problems of the sort "how many $x$ digit numbers are there with sum of digits $y$?", but I don't understand it. Why are the "bad" solutions in correspondence to the solutions of $y_1 + 10 + x_2 + x_3 + x_4 + x_5 = 23$? What's the idea?

For instance, what "correct solution" corresponds to taking $y_1=13$? How to solve this problem?
The referred question asks for the number of non-negative integer solutions of
\begin{align*}
  x_1+x_2+x_3+x_4+x_5=23
  \end{align*}
with only one additional restriction $0\leq x_1\leq 9$. In this case we do not need the inclusion-exclusion principle.


  In order to determine all integer solutions with
  \begin{align*}
  x_1+x_2+x_3+x_4+x_5=23\qquad\qquad0\leq x_1\leq 9,0\leq x_2,x_3,x_4,x_5\tag{1}
  \end{align*}
  
  we look at all integer solutions of
  
  \begin{align*}
  x_1+x_2+x_3+x_4+x_5=23\qquad\qquad\qquad\qquad 0\leq x_1,x_2,x_3,x_4,x_5\tag{2}
  \end{align*}
  
  and subtract all solutions of
  
  \begin{align*}
  x_1+x_2+x_3+x_4+x_5=23\qquad\qquad\qquad x_1\geq 10, 0\leq x_2,x_3,x_4,x_5\tag{3}
  \end{align*}


The solutions of (3) are the so-called  bad solutions in the referred question, meaning the invalid solutions which are to subtract when determining the solutions of (2).


  In order to calculate (2) with the nice range $x_1,x_2,x_3,x_4,x_5\geq 0$ we can use the stars-and-bars
  technique and obtain
  \begin{align*}
  \binom{23+4}{4}=\binom{27}{4}=17550
  \end{align*}


In order to calculate (3) we transform the range by a proper substitution which enables us to apply the stars-and-bars technique again. Instead of $x_1\geq 10$, we substitute $x_1=y_1+10$ and the range $x_1\geq 10$ can then be transformed to $y_1+10\geq 10$ or equivalently $y_1\geq 0$.


  This way we obtain from (3)
  
  \begin{align*}
  x_1+x_2+x_3+x_4+x_5&amp;=23\qquad\qquad\qquad x_1\geq 10, 0\leq x_2,x_3,x_4,x_5\\
  (y_1+10)+x_2+x_3+x_4+x_5&amp;=23\qquad\qquad\qquad 0\leq y_1,x_2,x_3,x_4,x_5\\
  y_1+x_2+x_3+x_4+x_5&amp;=13
\end{align*}
  
  We are now in the same situation as in (2) and can apply the stars-and-bars technique again.
  
  \begin{align*}
  \binom{13+4}{4}=\binom{17}{4}=2380
  \end{align*}


$$ $$


  We finally obtain the number of wanted solutions as the total number of solutions of (2) minus the number of solutions of (3) 
  \begin{align*}
  \binom{27}{4}-\binom{17}{4}=17550-2380=15170
  \end{align*}
I'm also not great at combinatorics, but I'll give this a shot to give you a start. This isn't going to be an answer, but an extended comment.

First, we need to establish the number of nonnegative numbers satisfying \begin{equation}\sum_{i=1}^5 x_i=23\end{equation} (call this (*)). This is a standard stars and bars type problem, where we have $23+(5-1)=27$ stars and $5-1=4$ bars. But we've overcounted, because some of these solutions will have some of the numbers being greater than or equal to 10, which should not be allowed because we wants a 5 digit number. For this, we can use the inclusion-exclusion principle (we want the second quoted equation).

Let $A$ be the set of solutions to (*) where none of the integers is greater than or equal to 10, $B$ the set of solutions where 1 integer is greater than or equal to 10, and $C$ where two of the integers are greater than or equal to 10. After this, we're done, because at most 2 of the $x_i$ in the solutions we counted can be greater or equal to $10$. Then
\begin{align} |A\cup B\cup C|= |A| + |B| + |C| - |B\cap C|\end{align} (I excluded the parts of the sum that were empty). We want to know $|A|$, we know $|A\cup B \cup C|$, so we need to compute $|B|,|C|,|B\cap C|$. How one would compute $|B|,|C|$ is given, more or less, in the answer I quoted in the comments. 

How one would compute $|B\cap C|$, I'm not sure off the top of my head. We also need to exclude the solutions where $x_1=0$. In the quoted method, the number is small enough to count by hand. For this case we would need a more robust method.

Edit: See also here for ideas. I'm out the door, but best of luck to you!

Edit 2: Back, and I messed up a little in haste. $B\cap C$ is obviously equal to the number of solutions where exactly 2 numbers are $\geq 10$. So we can just take $|A\cup B\cup C|=|A|+|B|+|C|$, where $A$ is as before, $B$ is the number of solutions with exactly one number $\geq 10$, and $|C|$ the number of solutions with exactly two numbers $\geq 10$. Then we'll need to refine by excluding the case where $x_1=0$, this can be done with the trick $x_1'=x_1-1$, though some care will need to be taken.