A stretched string will vibrate to make a note.
There are three ways you can make it vibrate. You can strike it a sharp blow (a piano), you can pluck it (guitar) or you can drag a bow across it, so that the bow rapidly judders (violin).
In all cases the sound made depends on the length of the string being vibrated. Short lengths give high notes, longer strings give low notes.