The question is not clear.
I will take a guess at what you meant
You have 30 Choc Chip cookies
and 24 sugar cookies..
What is the largest divisor or factor of 30 and 24 have in common?
30 Factors (1,2,3,5,6,10,15,30)
24 Factors (1,2,3,4,6,8,12,24)
6 is the largest factor
So you can create 6 bags:
6 ×5 is 30
6×4 is 24
containing 5 Choc Chip and 4 sugar in each bag.