It's a convention to help us to get a quick understanding of the commit. The commit should follow a defined structure.
You can use tools like pre-commit hook to enforce devs using the pattern and also add the command in the pipeline.
https://github.com/conventional-changelog/commitlint
You can check more about why to use it here:
https://www.conventionalcommits.org/en/v1.0.0/#why-use-conventional-commits