1) Open Metamask, and select "Custom RPC" from the Network Dropdown.
2) In the "Custom RPC" Settings, add in the xDai network details and click Save:
Network Name: xDai
New RPC URL: https://rpc.xdaichain.com/​
ChainID (Optional): 100
Symbol: xDai
Block Explorer URL: https://blockscout.com/poa/xdai​
If you'd prefer not to make these changes, Nifty Wallet provides a built-in xDai RPC.
Instructions for using MetaMask with a Ledger or Trezor: https://metamask.zendesk.com/hc/en-us/articles/360020394612-How-to-connect-a-Trezor-or-Ledger-Hardware-Wallet​