This seems like a very complicated question, the sort of thing where you’d need to write a book just to cover the special cases. For example, some people may have oaths, professional ethics, or ancient traditions requiring them to help even the worst people:
Public defenders are expected to defend even obviously evil people, who still have a right to competent legal representation.
Some versions of medical ethics require providing emergency aid without discrimination.
Maritime tradition requires aiding “those in peril on the sea”, if such can be done so safely. This is backed up by maritime law in some countries. This may even include people whose ships you just sank, if you can safely make them prisoners of war.
At the opposite end, there are things like selling equipment or software to countries or companies under nuclear sanctions, where the law will be very unhappy. Known terrorists likely fall into a similar category, where providing many common services may put you at legal risk.
Then there are other questions:
Would you refuse common services to masked, anonymous government agents that you believe are committing crimes?
The TTRPG question: Will your good-aligned party work with a Lawful Evil villain to avoid a terrible fate? There have been some real-world analogs to this question, too.
How do your answers to all these questions change if your legal system isn’t particularly effective?
Like I said, this feels like you could write a book.
I can think of one famous fantasy story that happens after the kids have recently left home, Lois McMaster Bujold’s Paladin of Souls. The protagonist, Ista, is the dowager mother of a very young queen. Ista is still in early middle-age, but her relatives suspect that she’s losing it. She weeps, she says cryptic things that make no sense, and she argues with the gods. So Ista finds herself hemmed in. For her own good, of course.
And one day, she decides to say “Screw it”, and goes striding out the castle door and off down the road. This does not improve her guardians’ opinion of her mental health, of course. But before Ista is rounded up, she meets dy Cabon, a priest of the fifth god, the Bastard. The Bastard has a fascinating divine portfolio, including orphans, crows, the LGBTQ community, justice when all human justice has failed, and “disasters out of season.”
And so Ista formulates a second plan to escape her daily life, ordering dy Cabon to prepare a religious pilgrimage. And much to dy Cabon’s surprise, he finds himself dogged by divine visions encouraging Ista’s voyage. You see, the Bastard has use for Ista. She is, after all, “a disaster out of season.” And if Ista curses the gods? There’s one god who considers that as holy as any other prayer.
Paladin of Souls won the Hugo, Nebula and Locus awards, and it was notoriously a favorite book of r/fantasy.