Help! Game 2d

How to make the character give a boost when jumping on the enemy’s head ?

I have no idea how to do this