I was hurt by a stranger and so I have no clue about his past. How can I do the thinking work of forgiveness toward this person, given that I know nothing about him?
We talk about taking the personal, the global, and the cosmic perspectives when trying to understand and forgive another person. The personal perspective, which you find difficult to take, asks the forgiver to examine the past of the offending person and to see if this person suffered injustices and emotional wounds from others. Because you cannot know these issues, you can move to the global and cosmic perspectives. I will share only the global perspective for you here. If you find it helpful, then you might want to go more deeply and consider the cosmic perspective, depending on your belief system.
In the global perspective, we ask people to see the common humanity between yourself as forgiver and the one who offended you. Here are some questions centered on the global perspective: Do you share a common humanity with the one who hurt you? Do you both have unique DNA in that, when both of you die, there never will be another human being exactly like you on this planet? Does this make you special, unique, and irreplaceable? Does this make the one who hurt you special, unique, and irreplaceable? Will that person die some day? Will you die some day? You share that as part of your common humanity. Do you need sufficient rest and nutrition to stay healthy? Does the one who hurt you need the same? Do you see your common humanity? In all likelihood, even though you cannot know for sure, that person has been treated unfairly in the past by others. You very well may share the fact that both of you carry wounds in your heart.
For more information, see Forgiveness Defined.