G causes the cursor to go to the nth line in the buffer. Pressing the y key causes the specified object to be yanked into a supplementary buffer. Vi has many ways to specify an object. Vi has more than one supplementary buffer, the particular one used in this example is known as the unnamed buffer. A yanked object is not removed from the window, or from the file, but a copy of it is placed in the unnamed buffer.
D deletes everything from the current cursor position to the end of the line.
For example, if you delete something by mistake, you can get it back by pressing the u key. Whole lines are placed below the cursor. P causes whatever is present in the unnamed buffer to be placed in the main buffer before the cursor. Whole lines are placed above the cursor. It also writes over the character where the cursor is when you press the s key.