Let's replace $f(x_i)$ with $y_i$, to reduce clutter. We start with $ y_2 = y_0 + \frac{y_1-y_0}{x_1 - x_0}(x_2 - x_0) + b_2(x_2-x_0)(x_2-x_1). $ We want the factor involving $b_2$ on one side, and the rest on the other side. So let's move the first two terms from the right-hand side to the left-hand side: $ y_2 - y_0 - \frac{y_1 - y_0}{x_1 - x_0}(x_2 - x_0) = b_2(x_2 - x_0)(x_2 - x_1). $ In order to isolate $b_2$, we need to divide by $(x_2 - x_0)(x_2 - x_1)$. Let's do it in two steps. First divide by $x_2 - x_0$: $ \frac{y_2 - y_0}{x_2 - x_0} - \frac{y_1 - y_0}{x_1 - x_0} = b_2(x_2 - x_1). $ Now divide by $x_2 - x_1$: $ \frac{\frac{y_2 - y_0}{x_2 - x_0} - \frac{y_1 - y_0}{x_1 - x_0}}{x_2 - x_1} = b_2. $ We got a different formula.
In order to get the formula you stated, we need to somehow come up with the expression $y_2 - y_1$. So let's subtract $y_1$ from both sides of the original equation: $ y_2 - y_1 = y_0 - y_1 + \frac{y_1-y_0}{x_1 - x_0}(x_2 - x_0) + b_2(x_2-x_0)(x_2-x_1). $ We have $ y_0 - y_1 + \frac{y_1-y_0}{x_1-x_0}(x_2-x_0) = \frac{y_1-y_0}{x_1-x_0}(x_2 - x_0 - (x_1 - x_0)) = \frac{y_1-y_0}{x_1-x_0}(x_2 - x_1). $ For this calculation, we wrote $ y_0 - y_1 = \frac{(y_0-y_1)(x_1-x_0)}{x_1-x_0}. $ Substituting this simplification into the equation, we get $y_2 - y_1 = \frac{y_1-y_0}{x_1-x_0}(x_2-x_1) + b_2(x_2-x_0)(x_2-x_1).$ Let's move everything to the correct side: $y_2 - y_1 - \frac{y_1-y_0}{x_1-x_0}(x_2-x_1) = b_2(x_2-x_0)(x_2-x_1).$ Now divide first by $x_2 - x_1$ (looking toward our goal): $\frac{y_2 - y_1}{x_2 - x_1} - \frac{y_1-y_0}{x_1-x_0} = b_2(x_2-x_0).$ Next divide by $x_2 - x_0$: $\frac{\frac{y_2 - y_1}{x_2 - x_1} - \frac{y_1-y_0}{x_1-x_0}}{x_2-x_0} = b_2.$ And we're done.