Which Bluetooth codec is best is situational, dependent upon what devices you're using to send and receive audio and the quality of the audio itself. To best understand the difference between codecs, there are a few different measurements that are important to know. In simplified terms, it all comes down to bits of data.
Bit rate: How much data is sent per second; the more data that can be sent at once, the more of the original quality of the audio is preserved
Audio bit depth: This is the number of bits in each second of audio, which impacts the highs and lows of audio able to be communicated on the other side; the higher the bit depth, the better the dynamic range
Sample rate (kHz): The sample rate of the music per second — essentially how many times a snapshot of the audio is captured. The more it's sampled, the more accurate the snapshot. The most common sample rate in music production is 44.1kHz, which means that 44,100 snapshots are captured per second.
The standard codec is SBC, which is receivable by and included on every Bluetooth device. For all other codecs, it's a case-by-case basis for whether they'll be compatible with your device, making it important to check the finer details on your headphones or speakers. Some codecs, like the Sony-developed LDAC and Samsung Scalable, are proprietary, making the tech that supports it more niche. Though AptX codecs are more widely supported, it's still a family of codecs owned by Qualcomm, meaning that some (like AptX HD) require specific licensing if you want to, say, use it on your PC. Looking at just the raw data, this is how the most common Bluetooth codecs compare.