How can I make on my own? What functions I need to use in Adobe Illustrator for 'waving' words?
You could use Object > Envelope Distort > Make with Mesh. Set the number of rows the same as the number of lines of text, and columns to 1. Then edit the mesh using the Direct Selection Tool A.
In the example below, to get this to work better, I also converted the text to outlines and added an invisible box around the text and grouped them, so that the mesh fitted between the lines of text exactly.