One formula for the slope of the regression line of Y on X is $b = rS_y/S_x.$
You have $S_x^2 = 6170.4/9 = 685.6,$ so $S_x = 26.18396.$
You can find $S_y$ in the same way. (Formulas for $b$ can be sensitive to
premature rounding. Do not round anything until you get the value for $b$.
I mention this because the problem-image you attached has too much rounding
for my taste.)
The correlation is $r = \frac{(1/9)\sum(X_i-\bar X)(Y_i - \bar Y)}{S_xS_y}.$
So the formula $b = rS_y/S_x$ amounts to the same thing as the formula you show.
My formula using $r$ may be useful because, in practice, one often looks at
descriptive statistics $r, \bar X, \bar Y, S_x,$ and $S_y$ before starting to do a regression.
Sometimes, it is helpful to consider units. For example, suppose you are interested in books in a series and want to model the cost $Y$ of a book in terms of the number $X$ of pages. Looking at the regression equation $Y_i = a + bX,$ it is clear that $Y$ and $a$ have units
in pounds, euros or dollars, and that $X$ is in terms of pages. That means
that the units of $b$ must be something like pounds per page. [Both formulas
for $b$ are in terms of Y-units per X-units (remembering that $r$ has no units).]
It is incorrect to say "regression line between X and Y." It is either
the regression line of Y on X (which you are doing), or the regression line of X on Y. Variables are usually named so its regression of Y on X. But the regression of X on Y would be an entirely different thing. Make sure you're working the right problem.