In order to create a new product attribute in Magento 2 please go to Admin Panel > Stores > Attributes > Product.
Once you've got there press the Add New Attribute button.
1. Enter a Default Label of an attribute. It will be displayed on the admin panel.
2. Choose a type of an attribute in the Catalog Input Type for Store Owner field. There are such available values here as: Text Field, Text Area, Date, Yes/No, Mutliple Select, Dropdown, Price, Media Image, Fixed Product Tax, Visual Swatch,Text Swatch.
3. Select yes in Values Required field in order to make the attribute required for products. In this case, you won't be able to save the product with this attribute if you don't set its value.
Advanced Attribute Properties
1. Set the Attribute Code. If you leave this field empty, the attribute code will automatically be generated from the default label.
2. In Scope you choose a level the attribute will be edited on. As far as Magento 2 is a multilingual and multi-website platform it is better if it is the text field attribute to leave it on a Store view level. In case attribute value doesn't depend on site or language it will be wiser to choose Global.
3. Set a Default Value of an attribute. We pay your attention to the fact default value won't be automatically set all existing products. It will be added only after the resaving of product.
4. In the Unique Value field set Yes, if you don't want the same attribute value to be applied to different products, e.g. SKU attribute should be unique.
5. In Input Validation for Store Owner set filter that will be used before saving a product to validate an attribute value.
6. filter Yes in the Add to Column Options field in order to add the attribute to the list of column options in the product grid.
7. If you want this attribute to be used while filtering of products choose Yes in Use in Filter Options field.
Set a Default Store View which will be displayed of the Storefront. In case you have a multilingual site, you can set a label for each language.
1. If you want the attribute to be used while search, choose Yes in the Use in Search field.
2. In the Comparable on Storefront field you can select whether this attribute will be used on compare product page.
3. In Used in Layered Navigation you choose the attribute to be used in layered navigation.
4. You choose whether the attribute will be used in layered navigation search in the Use in Search Results Layered Navigation.
5. In Position field, you set the position of the attribute in the layered navigation.
6. Choose Yes in the Use for Promo Rule Conditions field if you want this attribute to be used in rule conditions for cart price rules and catalog price rule as well.
7. In order to make the attribute displayed on a product page in additional options, choose Yes in the Visible on Catalog Pages on Storefront field.
8. Choose Yes in Use in Product Listing to add this attribute value to the PHP product object in a product list (product collection).
9. If you want the attribute to be used for the sorting process choose Yes in the Used for Sorting in Product Listing field.
Once you have finished don't forget to press the Save Attribute button.
Assign to Attribute Set
Afterwards, go to Admin Panel > Stores > Attributes > Attribute Set, choose the attribute you need, drag and drop it from the Unassigned Attributes to Groups.
Once you have finished don't forget to save the attribute set.