In the books they just walk there, accompanied by Argus Filch. In the movies, however, they're taken there in carriages.