The relation below is simply the definition of the generalized momentum. It requires no proof, as is true by definition:
$$ p_i = \dfrac{\partial \mathcal{L}}{\partial \dot{q_i}} $$
Now according to Lagrangian Mechanics, we aim to find the equation of motion $q(t)$ which minimizes the action $S = \int \mathcal{L}(q, \dot{q}, t) \cdot dt$; note that we are fixing the starting points and ending points of the trajectory to specific points (i.e. what trajectory $q(t)$ which starts at $(q_1, t_1)$ and ends at $(q_2, t_2)$ minimizes $S[q]$). Turns out action is minimized if and only if this equation is satisfied:
$$ \dfrac{\partial \mathcal{L}}{\partial q} = \dfrac{d}{dt} \dfrac{\partial \mathcal{L}}{\partial \dot{q}} $$
$$ \therefore \dfrac{\partial \mathcal{L}}{\partial q_i} = \dot{p}_i $$
So the latter equation is a ramification of the axiom which states $S[q]$ needs to be minimized. The derivation of this equation is proven in many physics or functional analysis textbooks.
Edit: Your textbook should prove this itself, but you can also look into theorem 6.1 of this file https://scholar.harvard.edu/files/david-morin/files/cmchap6.pdf