According to ques, there are 12 black and 12 brown socks.
In order to take out 2 black socks, lets consider what might be the worst case.
I pulled out 1st and it turned out to be brown, then i took 2nd and it also turned out to be brown. Doing so till 12th sock, it turned out all brown socks. But now all brown socks are over and black socks are left only. So the next 2 socks would be black for sure. Hence total attempts in order to take out at least 2 black socks are 14.