40. ... Bb4!
At which point white resigned because of:
41. Qxd8 Qxd8
This is apparently the least worst option for white.
There are other possibilities for white but analysis says they are even worse e.g.
41. Qb6 Rxd5
or
41. Qxa6 Rxd5
etc.
Other good moves for black would have been:
40. ... Bf7
or
40. ... Qd6
However, neither of these moves was actually played and they may not have resulted in resignation. Analysis says they are not quite as strong as the move which black chose.