Make sure the machine you'll be building on has the recommended requirements; the bare minimum is 32GB RAM, if you are going to use zram during the build. Decreasing the job count will help with RAM usage, and could even possibly get it to build on 8GB RAM, but I recommend 48GB or more of RAM.
Create the directory you'll do your build in with mkdir crDroid && cd crDroid (substitute crDroid for whatever you want the folder to be called, it doesn't need to be called anything specific)
For Debian 12 and newer (as of Feb 2025) (or any distro based on Debian 12 or newer, with these packages in the repos) run this:
sudo apt install bc bison build-essential ccache curl flex g++-multilib gcc-multilib git git-lfs gnupg gperf imagemagick lib32ncurses5-dev lib32readline-dev lib32z1-dev liblz4-tool libncurses5 libncurses5-dev libsdl1.2-dev libssl-dev libxml2 libxml2-utils lzop pngcrush rsync schedtool squashfs-tools xsltproc zip zlib1g-dev
After this is install