How to create this type of animation?

Hi guys! Could you explain to me please how to create this type of animation?
The thing is that i can’t create smooth animation for my string and ball.