NixOS: You already have it!
Others: Follow the instructions on nixos.org to install Nix on your machine.
Nix flakes are still considered experimental, so you will have to enable them.
NixOS wiki has instructions on how to enable flakes.
Direnv is a shell extension that enables you to load up you nix environment in the shell of your project directory.
It provides the best developer experience for most starters.
There are two steps for installing direnv. Installing it on your system and hooking up your shell.
You can install direnv in your favorite package manager Nix 😗
Hooking into your shell is well documented on the official direnv site