(a) There is no "formula." It's called thinking.
Consider quadrilateral BCDE. The interior angles, in counter-clockwise order, are 180-y, 40, 180 - (2y+15), and 140. These add up to 360, so set up an equation and solve for y.
(b) Once you have found y, note that triangles ABE and ACD have an angle in common. You can probably use AAA similarity.
For the first problem, it should be clear that angle ACD has measure 180- 140= 40 degrees and that angle ADC has measure 180- (2y+ 15)= 165- 2y degrees. That means that Angle CAD has measure 180- 40- 165+ 2y= 2y- 25 degrees. Then, since angle AEB has measure 40 degrees, angle ABE has angle 180- 40- (2y- 25)= 165- 2y= y.