How can I call a function using Animnotify?

All you need to do is add a

UFUNCTION()
 void AnimNotify_MyNotify();

function to your AnimInstance, and Unreal will automatically call it when the notify fires. Basically, just name the function AnimNotify_YOURNOTIFYNAME and make it visible to Unreal with UFUNCTION().