"Still got yer letter, Harry?" he asked as he counted stitches. Harry took he parchment envelope out of his pocket. "Good," said Hagrid. "There's a list there of everything yeh need." (PS5)
With their acceptance letter to Hogwarts, all students receive a shopping list of things to buy. It includes robes, a hat, a wand, books and equipment (PS5).
First years who can't afford the necessary supplies, there is a fund from Hogwarts to support them. Some supplies can be bought secondhand as well (HBP13).