Let’s start with finding mCAB. Segment CD is a straight line that runs through A, so we know it is a total of 180°. The problem tells us that there is a right angle (90°) and gives us that 31° in between. Since they all have to add up to 180, we can do 180 - 90 - 31 = ...59°!
Now that we have mCAB, we can find mABC. All the angles in any triangle must add up to 180. Since we now know mCAB (59°) and mCBA (40°), we can subtract to find the missing angle. 180 - 59 - 40 = ...81°!