Transfer animations between models

Hello, good afternoon. I need help for my game. I need to make a model perform the animations of another model. The problem is that the models have different bones, and I don’t know how to do it. I also wanted to ask if there is any way in which the model with the animations, transfers them to the other model, and is made with their respective bones. I attach images of the models.

If both are humanoid, it should “just work”.