why post_class() function apply css classes to all other files?

I use the post_class() function to add a custom class of CSS like width and display property. But it applied to all other files like the about page, contact page. I tried to use the WordPress class instead of using the class attribute of HTML. I have referred wordpress.org. I thought post_class can use for WordPress predefined class and also for adding custom classes. It’s a right or wrong method. Please suggest if anyone knows, where to use the post_class()? and it is ok to use post_class() for adding custom classes.

How to create a field in customize and show that in header.php?

I am new to WordPress coding and learning this from stackexchange,
I am trying to create one WordPress website from scratch, in header I want to show contact information for example phone number,
I want to create a field in customize and want to display the value in header.php.
Is there any guide or tutorial for that? Any help will be appreciated. Thanks a lot!!
*don’t want to use plugin