How do you know it was deleted if it is no longer there anymore? The same question for insertions, how do you know that it wasn't always there in a genome sequence
By comparing what came first and what happened later, and if that's not possible then by comparing anything we can put our hands on.
For example, say an ancestor had the DNA ABC-AD-BDC-BAC.
If we get 5 current species with DNA that looks like
1 ABC-ADD-BDC-BAC
2 ABBBC-AD-BDC-BAC
3 ABC-AD-B-BAC
4 AB-AD-BDC-BAC
5 ABBBC-AD-BDC-BC
(not in any particular order)
we could tell what had been deleted and what had been inserted based on the idea that if your ancestor had it, it is far more likely to be present now than if they didn't: the probability of something being lost almost completely is much lower than the probability it was never there to begin with but was picked up later by a couple of descendants, and vice versa. For example, almost every species has BAC in the final section so we would guess that the ancestor also had it (unless these species are all more closely related than that, but see next).
By examining what, if any, record exists, we can also narrow down the possibilities and confirm our guesses. In the above example, you would not know whether the DC in the third section had been inserted or deleted from the original ancestor because the ratio is pretty close. But if you also knew that species 2 came before species 3, you could tell the mutation in that case was deletion. Likewise for the BB in the first section, you can tell it was an insertion because (say) species 1 existed before species 2. It's not only the DNA of one thing we look at, it's the DNA of anything and everything plus the records of when what happened.
If you can find a simple evolutionary algorithm that provides you with a record, get hold of the last 3 generations, then see how well you can construct the tree backwards to the original ancestor by comparing what you know came first and what came later, and by how common something is. That's basically how it gets done in the real world.