In this example we are multiplying two binomials so FOIL method can be used.
$$ \begin{aligned} \left( \color{blue}{ 5y-1}\right) \cdot \left( \color{orangered}{ y-7}\right) &= \underbrace{ \color{blue}{5y} \cdot \color{orangered}{y} }_{\text{FIRST}} + \underbrace{ \color{blue}{5y} \cdot \left( \color{orangered}{-7} \right) }_{\text{OUTER}} + \underbrace{ \left( \color{blue}{-1} \right) \cdot \color{orangered}{y} }_{\text{INNER}} + \underbrace{ \left( \color{blue}{-1} \right) \cdot \left( \color{orangered}{-7} \right) }_{\text{LAST}} = \\ &= 5y^2 + \left( -35y\right) + \left( -y\right) + 7 = \\ &= 5y^2 + \left( -35y\right) + \left( -y\right) + 7 = \\ &= 5y^2-36y+7; \end{aligned} $$