Based on this tutorial.
Prerequisites:
% sw_vers
ProductName: macOS
ProductVersion: 11.6
BuildVersion: 20G165
% npm --v
8.1.2
% git --version
git version 2.32.0 (Apple Git-132)
And the MetaMask browser extension
mkdir hardhat-tutorial
cd hardhat-tutorial
npm init --yes
npm install --save-dev hardhat # This apparently has to be locally installed.
npx hardhat
npm install --save-dev @nomiclabs/hardhat-ethers ethers @nomiclabs/hardhat-waffle ethereum-waffle chai