Let's say there are N objects in a set. Now you need a rule for the subset. Whatever obeys the rule stays in the set, whatever doesn't you put to one side. Those that obey the rule are in the subset and they can be counted just as the original objects were. You may have to apply the rule to every individual object in the original set, or there may be a way of separating out the whole subset or build up from groups instead of counting each individual object.
For example, all the numbers from 1 to 100 form the original set, where N=100. The subset may consist of just the odd numbers. You can count them individually: 1, 3, 5, etc., or you can find a formula: 2n-1, that generates them. Then you need to find the range of n. When n=1 we get 0, the first in the subset, and when n=50 we get the last, 99. So n ranges from 1 to 50, which is 50 objects. So the size of the subset is 50.