First, update to v22. Then go into Configure → Project Defaults → Project Structure → Project
Add a new SDK, referencing wherever you installed it. Fiddle with stuff on these screens until nothing is red. Go to SDK. Again, you want no red.
There are taken from Windows, may be slightly different on Mac