Lets break this down even more just to be clear.  Here is an example:

[Goblin][1] has 7 Hit Points, 15 AC.
Character swings a short sword which they are proficient with.  Short sword has the [finesse property][2], so the character can choose between Strength or Dexterity.  Let's say they choose strength and a +1 STR MOD.

 1. Character [rolls for attack][3] -- rolls D20 to hit against the Goblin's Armor Class and succeeds with a roll of 14 + 1 STR MOD + 2 [PROFICIENCY BONUS][4] = **17 to hit** (which is >= 15).

 2. Character [rolls damage][5] for short sword rolls a D6 and gets 3 + 1 STR MOD = **4 damage**. Damage doesn't include proficiency. The [modifier is the smaller derived from the larger ability score][6].

 3. Goblin calculates remaining HP.  7 - 4 = **3 HP** left for the Goblin.

The goblin flees.  Finds a place to take a [short rest][7] of 1 hour (or more) and chooses to roll its [hit dice][8] to heal some of that damage... 


  [1]: https://www.dndbeyond.com/monsters/goblin
  [2]: https://www.dndbeyond.com/sources/basic-rules/equipment#WeaponProperties
  [3]: https://www.dndbeyond.com/sources/basic-rules/combat#MakinganAttack
  [4]: https://www.dndbeyond.com/sources/basic-rules/customization-options#ProficiencyBonus
  [5]: https://www.dndbeyond.com/sources/basic-rules/combat#DamageRolls
  [6]: https://www.dndbeyond.com/sources/basic-rules/using-ability-scores#AbilityScoresandModifiers
  [7]: https://www.dndbeyond.com/sources/basic-rules/adventuring#ShortRest
  [8]: https://www.dndbeyond.com/sources/basic-rules/step-by-step-characters#HitPointsandHitDice