When you reduce an enemy to 0 Hit Points, you gain Temporary Hit Points equal to your Charisma modifier plus your Warlock level (minimum of 1 Temporary Hit Point). You also gain this benefit if someone else reduces an enemy within 10 feet of you to 0 Hit Points.
RollQuest ships the D&D 2024 SRD as a content pack, on a 5e character sheet that does the maths - roll from the sheet and let the numbers work themselves out. Free to start.