Sitecore comes with cool out-of-box field validators that can be applied to each template field, depending on its type. Obviously we can create our custom field validators and here I will explain how to create one.
As a Sitecore developer, when you add a field in a template and want to restrict the input of content editors, applying a business logic or you just want to ensure the inserted value is valid we should definitely use field validators.