At level 1, your hit points are the maximum of your class’s hit die plus your Constitution modifier. A level-1 fighter (d10) with 14 Constitution (+2) starts at 10 + 2 = 12 HP.
At every level after that, you add either the average of your hit die (rounded up) or a fresh roll (try it in the dice roller), plus your Constitution modifier again. The averages are d6 → 4, d8 → 5, d10 → 6, d12 → 7. HP is cumulative — you keep everything from earlier levels.
Your hit die is set by class (see the table). If your Constitution modifier changes, the bonus applies to every level you have, so raising Constitution boosts your maximum HP retroactively — a +1 to the modifier adds 1 HP per level. The Tough feat adds another 2 HP per level.
For the full level tables and hit dice by class, see the Cleric, Paladin and Warlock class guides.