1. Find the interesting octet
Write the prefix as a mask. The interesting octet is the one that’s neither 255 nor 0: for a /20 (255.255.240.0) it’s the third.
If the prefix is a multiple of 8 (/8, /16, /24), there’s no interesting octet: keep the network octets and zero the rest.