What defense does?

Im new to DnD and i want to make a new charcter, he is a warlock with 11 hp and 13 armor class. what should i do when i get attacked? dmg – defense? I dont have the books, im using DnD Beyond