50% is another way of writing 0.50 or 1/2.
Blue cotton candy is 50%, there are 22 blues, therefore 22 is 50% of the total number.
Using algebra,
0.50x=22
X=44
Another way to think about this is simply to consider that 50% is half, and if 22 is half then one need only multiply by two to get the whole.