On this page of the Darkest Dungeon 2 guide, you will learn what Mastery Points are, how to spend and earn them.
Mastery Points are earned randomly, mainly from victorious battles - i.e. you don't always get them. They are represented by blue diamonds and shown in the inventory. They are used to improve the skills of the heroes - one point is one upgrade. Each skill can only be upgraded once. You can upgrade skills only at the Inn. By hovering over a skill, you will see what parameters will change after it is promoted to the Master level.
If you are not satisfied with the allocated Mastery Points, you can reallocate them using the reset button in the skill window in the Inn. This is a free action - all heroes' Mastery Points are restored simultaneously. This only applies to the currently assigned points - once you go on an Expedition, the distributed points will be assigned permanently.