Learning about inverse-z-transform and how to apply it to a rational transfer function I have been studying IIR filters and know that a rational transfer function:

$$
H(z) = \frac {b_0 + b_1 z^{-1} + ... + b_N z^{-N}}{1 + a_1 z^{-1} + ... + a_N z^{-N}}
$$

has a finite difference equation:

$$
y[n] = b_0 x[n] + b_1 x[n - 1] + ... + b_n x[n - N] - a_1 y[n - 1] - ... - a_N y[n - N]
$$

What I am confused about is how the transformation from transfer function to difference equation is performed.

I have read about the z-transform and the inverse z-transform and understand that the inverse z-transform is the key, but none of the internet sources I have read provide a joined up walk though of how to take a transfer function and derive a finite difference equation from first principles.

Could anyone recommend a good source, or explain the end-to-end approach?
You do not really need the inverse $\mathcal{Z}$-transform to derive the difference equation corresponding to a given rational transfer function. You just need to know that $z^{-k}$ corresponds to a delay of $k$ samples. The inverse $\mathcal{Z}$-transform of $H(z)$ would give you the corresponding impulse response, but you don't need the impulse response to write down the difference equation.

Knowing that

$$H(z)=\frac{Y(z)}{X(z)}$$

you can rewrite the equation given in your question as

$$Y(z)\left(1+a_1z^{-1}+\ldots +a_Nz^{-N}\right)=X(z)\left(b_0+b_1z^{-1}+\ldots +b_Nz^{-N}\right)\tag{1}$$

With the correspondences $Y(z)z^{-k}\Longleftrightarrow y[n-k]$ and $X(z)z^{-k}\Longleftrightarrow x[n-k]$ you can directly write down the difference equation from $(1)$:

$$y[n]+a_1y[n-1]+\ldots +a_Ny[n-N]=b_0x[n]+b_1x[n-1]+\ldots +b_Nx[n-N]$$


Here's a way to show that $\mathcal{Z}\{x[n-k]\}=X(z)z^{-k}$:

$$X(z)z^{-k}=\sum_{n=-\infty}^{\infty}x[n]z^{-n}z^{-k}=\sum_{n=-\infty}^{\infty}x[n]z^{-(n+k)}=\sum_{n=-\infty}^{\infty}x[n-k]z^{-n}$$