Easy way: $ $ lift inverse $\!\bmod 5\!:\ \overbrace{\color{#0a0}{a'} \equiv {\large \frac{1}{18}\equiv \frac{6}3}\equiv \color{#0a0}2}^{\!\!\!\textstyle\Rightarrow\, 18\cdot \color{#0a0}2 = \color{#0a0}{1\! +\! 7\cdot 5}}\,$ up to $\!\bmod 5^2$ as follows
$\!\!\bmod \color{#c00}{5^{\large 2}}\!: \dfrac{1}{18}\!\equiv\!\dfrac{\color{#0a0}2}{18\!\cdot\!\color{#0a0}2} \!\equiv\! \dfrac{\color{#0a0}2}{\color{#0a0}{1\!+\!7\cdot 5}}\equiv\,\overbrace{2(1\!-\!7\cdot 5)}^{\large \equiv \ 7},\, $ by $\ \color{#c00}{5^{\large 2}\!\equiv 0}.\,$ Generally if $\,{\overbrace{1/a\equiv a'\pmod{\!n}}^{\!\!\textstyle\Rightarrow\ a\color{#0a0}{a' = 1+j\,n}}}\,$
$\!\!\bmod \color{#c00}{n^2}\!:\ \dfrac{1}{a}\,\equiv\,\dfrac{\color{#0a0}{a'}}{a\color{#0a0}{a'}}\!\equiv \dfrac{\color{#0a0}{a'}}{\color{#0a0}{1+j\,n}}\equiv\, a'(1-j\,n),\ $ by $\ \color{#c00}{n^2\equiv 0},\,$ lifts inverse $\!\bmod n\,$ up to $\!\bmod{n^2}$
because, $ $ we have that: $\ (\color{#0a0}{1+j\,n})\,(1-j\,n)\:\! =\:\! 1-j^2\color{#c00}{n^2}\equiv 1,\, $ so $\ (\color{#0a0}{1+j\,n})^{-1}\equiv 1-j\,n$.
This can be viewed as using Hensel lifting (Newton's method) to compute inverses.
In general, as above, it is trivial to invert a unit + nilpotent by using a (terminating) geometric series, which is a special case of the general method of simpler multiples.
Of course we can also use general inversion methods $\!\bmod n^2,\,$ but usually they will be less efficient. There are a few worked examples using a handful of such methods (including all those in the other answers) presented here and here and here. This includes most all the common known methods (and their optimizations).
$\pmod{25}$
produces $\pmod{25}$ – J. W. Tanner Feb 09 '20 at 17:20