In every situation:
Intellect > Haste > Mastery > Crit > Vers
Simming will always be the best option when deciding whether an item is an upgrade.
Haste makes it so you cast your spells faster, reduce the CD of Channel Demonfire and Conflagrate, and increase Immolate's tick rate. This is why haste is our best secondary stat.
Mastery is just passive damage increase and has gained some value due to the talent Chaos Incarnate.
Critical Strike increases the chance of your spells dealing a critical chance. Crit also gives Chaos Bolt more damage. It provides 1% damage per 1% crit to it.
Versatility is just a passive damage increase and passive damage reduction stat.
The best way to calculate stat priorities for your character is to "sim" your character. Method Raider Jaerv has written a series of Metafy articles to help!How to Sim in World of Warcraft
The best race for the horde is a Orc followed by Troll and a Goblin.
For alliance it’s a Mechagnome followed by a Gnome, Dwarf, and Human. (Difference is 0.1-0.4%)
In 10.1.7 blizzard made it so you can also play Night Elf which can be useful in Mythic + and provides a decent DPS increase. You might still want to consider Dwarf in Mythic + because of Stoneform and how strong it is in dungeons, especially since there are a lot of bleed effects this season.
Rings: Devotion of Haste
Legs: Frozen Spellthread
Feet: Plainsrunner’s Breeze
Chest: Waking Stats
Cloak: Graceful Avoidance
Wrist: Devotion of Avoidance
Weapon: Sophic Devotion
In Dragonflight, there has been an introduction to primary stat + secondary stat gems. You can only have one of those equipped at a time. For warlocks, the best gems are Fierce Illlimited Diamond followed by Keen Ysmerald.
For Phial, Iced Phial of Corrupting Rage is the best simming option, but consider Tepid Phial of Versatility on some bosses where you can’t get high uptime on the corrupting rage phial or for high M+ dungeons.
Healing Potion: Dreamwalker's Healing Potion
Rune: Howling Rune
Augment rune: Draconic Augment Rune