The Messenger s.a.w.s said: “Izaar” (picture below), that’s why they used to wear that alot. That doesn’t mean that pants or anything other of the garment is allowed to hang below the ankles. The reason for that is, some people in the past used to do that out of arrogance and pride.
The Prophet (or ‘Abul Qasim) said, “While a man was walking, clad in a two-piece garment and proud of himself with his hair well-combed, suddenly Allah made him sink into the earth and he will go on sinking into it till the Day of Resurrection.
Allah’s Messenger (ﷺ) said, “While a man was dragging his Izar on the ground (behind him), suddenly Allah made him sink into the earth and he will go on sinking into it till the Day of Resurrection.”
You’re maybe thinking now: “I’m not doing this out of pride”. The problem is if you’re denying this, then it’s already a kind of arrogance. It isn’t allowed for us to immitate the kufar, and others that do bad things. Therefore we should shorten our pants, to avoid this punishment.
Look at this nice https://bit.ly/3JXvzED
NOTE: This doesn’t count for the sisters.