Imagine you have a really long and stretchy rubber band and you hold it at both ends. When you pluck the rubber band in the middle, it starts to shake and wiggle back and forth. This is called vibration.
A string on a musical instrument works the same way. When you pluck the string, it starts to vibrate back and forth, creating sound waves that travel through the air and into your ears. The speed and pattern of these vibrations determine the pitch and tone of the sound you hear.
So when a guitarist or violinist plays a note, they are causing the string to vibrate at a specific frequency, which produces the sound you hear. The thickness, length, and tension of the string all affect the way it vibrates, which is why different strings and instruments can produce very different sounds.