For pictures, we hope for extreme iconicity. Writing systems often originate in pictures, but end up looking quite abstract and conventional. That applies even to Chinese. So if you have a lot of symbols, and only a few of them look like animals, you can conclude that the ones that look like pictures really are pictures. That’s what happens with Linear B and its accounts of cattle and sheep, for example.
Numbers are often iconic as well, and they tend to occur in fixed places (like before symbols of cattle), and add up into sums. So in accounting texts, they are easy to pick. Even in astronomy texts, they can be identified with some work, because they are predictable. Mayan numbers were identified and deciphered long before Mayan hieroglyphs. We have not deciphered the Easter Island texts, but we do know they are calendars for the same reason.
What’s left are letters. They have regular distributions recurring within words, and based on how many distinct letters there are in the corpus, you can work out whether they are an alphabet, a syllabary, or ideograms.