How to implement a custom massaction dropdown for a backend grid?

Thank you so much, I will try this solution. I have another question, I hope you can help me, I want to put in the backend listing a select button with two options and I want to select one of them and then execute an actions. Attach I put an image to illustrate this.

Your custom mass actions dropdown is very similar to the standard one (it is located at the left side above the grid on your screenshot).
As an example, see how is the standard mass actions dropdown implemented for the backend CMS pages grid.