You can connect to Ethereum networks using providers in Ethers.js. The most common ways are:
// Connect to Ethereum mainnet
const provider = new ethers.providers.JsonRpcProvider();
// Connect to a specific network
const provider = new ethers.providers.JsonRpcProvider('https://mainnet.infura.io/v3/YOUR_PROJECT_ID');
// Connect to MetaMask
const provider = new ethers.providers.Web3Provider(window.ethereum);
// Connect to a testnet
const provider = new ethers.providers.JsonRpcProvider('https://goerli.infura.io/v3/YOUR_PROJECT_ID');
Providers are read-only by default. To send transactions, you need a signer.
Rewriting in plainer words…
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.