How to connect the Avalanche network to MetaMask?

Avalanche users can enjoy Ethereum Web3 and DeFi applications by connecting the network to MetaMask. Here’s a step-by-step guide to doing it.