A lot of cards don't directly do damage with their attack, but instead do something else useful.
For example, one
Alolan Vulpix has an attack Beacon which lets you get two Pokémon out of your deck.
If you're talking about the
Sun/Moon Zubat, for example, Astonish (for 1 psychic) reads:
Choose a random card from your opponent's hand. Your opponent reveals that card and shuffles it into their deck.
That's not directly damaging the opponent, but it does let you take a card out of your opponent's hand, which is of some use to you. You'll obviously have to eventually put a different Pokémon in eventually in order to do damage, but perhaps that's a useful thing to do while you're waiting to get Crobat out.
And just to be clear; that does count as an "attack", from the game's point of view, even though it doesn't deal any damage. (In fact, many of the attacks in the video game don't do any damage either - they are "buffs" (they make you stronger) or "debuffs" (they make the opponent weaker).)