dnd 5e – How does defense work?

I’m new to D&D and I want to make a new character, he is a warlock with 11 hp and 13 armor class. What should I do when I get attacked? Damage – defense?

I don’t have the books, I’m using D&D Beyond.