Call the number of cookies x

There are 7x/8 almond cookies, he gave away 1/2 * 7x/8 = 7x/16

There are x/8 chocolate cookies, he gave away 5/8 * x/8 = 5x/64

7x/16 + 5x/64 = 132

33x/64 = 132

x = 256

Note that 256 = 2^(8). You can tell without calculation that the number has to have lots of factors of 2, so if you were to guess then 256 would be high on the list.
Let “x” be the total number of cookies liam baked:

(7/8)x = almond

(1/8)x = choco

1/2 (7/8)(x) = almond given away = (7/16)(x)

5/8 (1/8)(x) = chocolate given away = (5/64)(x)

remaining almond + remaining chocolate = 132

(7/16)x+ (5/64)x = 132

7/16 + 5/64 = 132/x

28/64 + 5/64 = 132/x

33/64 = 132/x

33x = 8448/33 = **256**

7/8c = almond
1/8c = chocolate

1/2(7/8c)+5/8(1/8c)=132
since he gave away ½ the almond cookies and 5/8 of the chocolate ones.

1/2(7/8c)+5/8(1/8c)=132
is
.4375c+.078125c=132
0.515625c=132

132/0.515625c = 256

He gave away 1/2 of the Almond and a 1/2 + 1/8  of the chocos so we know right away that our answer has to be smaller than 132 \* 2 = 264 (because he gave away more than half)

Ok now on to the problemo:

Almond: 7/8
Choco: 1/8

Ok he gave away 1/2 the almonds and 5/8 of the chocos:

(1/2)\*(7/8) + (5/8)(1/8) = 7/16 + 5/64 = 28/64 + 5/64 = 33/64

So we know he gave away 33/64 of his cookies. We can use the cross product for the rest

33/64 = 132/X

33\*X = 132\*64

X = 132\*64/33 = 256 (answer checks out it's less than 264!)