Membership packs and subscriptions can be restricted to certain class types, say you only want to offer a Yoga Only membership, this is how to do it:
When creating and restricting a membership, enable Restrictions
From the dropdown, choose any of the class types you have created, in this example, we are selecting Yoga.
Note if restrictions is enabled and you do not select anything then the pack will be created without restriction, if that was a mistake, edit the membership, enable Restrictions and set the restrictions as needed.
Now your members will only be able to use this membership to book into the allowed classes.