Question 212822
50 = c + m + s

where c = chocochip, m = M&M and s = sugar.

Let's get everything in terms of one of the cookies to simplify.

Sugar cookies twice as many as chocochip: {{{s = 2*c}}}

Two more M&M than chocochip: {{{m = c + 2}}}

Now express total just in terms of chocochips cookies:
{{{50 = c + s + m}}}
{{{50 = c + (2*c) + (c+2)}}}
{{{50 = c + 2c + c + 2}}}
Simplify :
{{{50 = 4c + 2}}}
{{{50 (-2) = 4c + 2 (-2)}}}
{{{48 = 4c}}}
{{{48/4 = c}}}
{{{c = 12}}}

Now we know there were 12 chocochip. Plug in this number to find the others.
{{{s = 2*c = 2*12 = 24}}} Sugar cookies
{{{m = c+2 = 12+2 = 14}}} M&M cookies

Check your work by adding them all up: 
24 + 14 + 12 = 50