How to apply some rules to fields in native contact form? I use the native Drupal 8 contact form with different custom fields.

I need to apply some rules more precise than the classic "required". For example, telephone number accepts only numeric characters and needs to be filled with 10 characters.

What is the best approach to do that with Drupal in a native way ? Is there a module that can do it ?

I can do it with jQuery but i would like to do it on a server side way.
If your real case is the telephone example, you need to enable the Telephone module that comes with Drupal 8 Core. Then add the telephone field to your contact form in "Manage Fields".

If you think you're doing something "popular" chances are high that someone already did it (ie Telephone module), so don't rebuild the wheel.

If your scenario is some special use case, then you want to do a custom form validation for your form field. See How do I add a custom validation to an existing form/field?