In most states, when a candidate drops out, his or her delegates go to the national convention uncommitted to any candidate (that’s why it means they’re “pledged” after a caucus; they haven’t actually voted, and will only officially vote at the Democratic National Convention). From there, they can technically vote for anyone they choose, like a superdelegate.
On the other hand, some states like Virginia and Nevada require that delegates vote for their pledged candidate in the first round of the convention no matter what, The Atlanta Journal Constitution reports.
However, if a candidate drops out of the race and then goes on to endorse another active presidential candidate, then those delegates are expected to vote for the candidate the person has endorsed. Again, they’re not required to vote for anyone. For example, if Buttigieg and Klobuchar both endorsed Joe Biden after they dropped out, their delegates might vote for Biden at the convention, assuming Biden was still in the race by then. It doesn’t guarantee anything, but it increases the likelihood that a candidate’s delegates will go in a specific direction.