By selling all vehicles in the depot as the message informs you.
Open up the depot and then change mode from "append" to "sell". It will list all vehicle components in the depot and allow you to sell them without needing to construct a convoy. Also make sure that all convoys inside the depot have been sold. There has to be no vehicle components and no convoys in the depot in order for it to be demolish-able.
This error is a safety feature to prevent you from accidently destroying a depot containing a lot of convoys or vehicle components you did not want to get rid of. In theory there is nothing stopping an implementation of "sell all contents on destroy".