Hey there! I'm happy to help!
Up until 1913, Senators were chosen by the Legislator. The Constitution originally said in Article 1 Section 3:
"The Senate of the United States shall be composed of two Senators from each state, chosen by the legislature thereof for six Years; and each Senator shall have one Vote."
Eventually, the seventeenth amendment to the constitution was ratified in 1913, having the Senators chosen by the people thereof, not the legislature thereof.
Have a wonderful day! :D