I use an answer I gave to another question on Bézout's identity with some more details:
As an example, let's take $a=4258$, $b=147$.
Let's start with $r_0=4258, r_1=147$. If $q_i$ is the quotient and $r_{i+1} $ is the remainder at the $i$-th step (dividing $r_{i-1}$ by $r_i$), we have:
$$r_{i-1}=q_ir_i+r_{i+1} $$
whence:
$$r_{i+1}=r_{i-1}-q_ir_i$$
Claim: each remainder in the euclidean algorithm satisfies Bézout's identity.
Indeed, a simple induction shows that, if we write $r_i=u_i\cdot 4258+v_i\cdot 147$, the algorithm translates into the relations:
$$u_{i+1}=u_{i-1}-q_iu_i,\qquad v_{i+1}=v_{i-1}-q_iv_i$$
These relations allow for computing progressively all Bézout's coefficients without having to revert back. This is the Extended Euclidean Algorithm. Here is how it goes in the present case:
$$ \begin{array}[t]{r@{\qquad}r@{\qquad}r@{\qquad}r}
r_i &u_i &v_i & q_i\\
\hline
4258 & 1 & 0 & \\
147 & 0 & 1 & 28\\
\hline
142 & 1 & -28 & 1\\
5 & -1 & 29 & 28 \\
2 & 29 & -840 & 2 \\
1 & -59 & 1709 &\color{red}2 \\
\hline
\color{red}0& \color{red}{147} & \color{red}{-4258}
\end{array} $$
So $-59\times4258+1709\times 147=1$.
Note that, if you proceed one step further (in red), you obtain integers $u,v$ such that $u\cdot 4258+v\cdot147=0$, i.e. $\lvert u\cdot 4258\rvert=\lvert v\cdot147\rvert= \operatorname{lcm}(4258,147)$ – not really interesting here, as $147$ and $4258$ are coprime, but might be interesting in other cases.
Are the coefficients of Bezout's lemma easily computable ?
– Shubham Avasthi Jun 12 '15 at 16:54