There are tools that will help you do this but learning how to do it yourself can be quite informative.
you can place this in a button like this so that on clicking the button the actions will be applied to each tiddler
<$action-sendmessage $message="tm-add-tag" $param="mytag"/>
but you could add other actions there
If you see this you learn the fieldmangler widget is required for some "messages" and it will not work unless its wrapped as follows.
Noting fieldmangler defaults to currentTiddler so it needs to be where the currentTiddler value changes
So the final result you can test on tiddlywiki.com is
<$button>
<$list filter="[prefix[A]]">
<$fieldmangler>
<$action-sendmessage $message="tm-add-tag" $param="mytag"/>
</$fieldmangler>
</$list>
Tag below with mytag
</$button>
<$list filter="[prefix[A]]">
</$list>
Note how I include a list along with the button so I can see what I would impact.
You could have a filter stored elsewhere referenced in both list and button to make sure they have an identical filter. Even editable;
Now I have taught you to fish, https://kookma.github.io/TW-Commander/ will help you without learning as much
Regards
Tony