Create An Yes/no Attribute

To create an Yes/No attribute, go to admin STORES -> Product [Attributes] then click Add New Attribute button, create an attribute with Catalog Input Type for Store Owner of Yes/No

Then go to STORES -> Attribute Set [Attributes], select an attribute set you are using ( for example “default” ), then drag an attribute from Unassigned Attributes to Groups

So you just created an Yes/No attribute and ready to use it