While al-Sufi didn't have a telescope, he used his naked eye to observe the Andromeda Galaxy, which is bright enough to be seen without any instruments under dark skies.
Later, astronomers used progressively more powerful instruments to study the galaxy, including telescopes of increasing size and sophistication. The first telescopic observation of Andromeda was made by Simon Marius in 1612, using a telescope he built himself.
So, while the Andromeda Galaxy was initially spotted with the naked eye, it was the development and refinement of telescopes that allowed for more detailed observations and eventually the understanding of its true nature as a galaxy beyond our own.