Born to impoverished parents and bereaved of his father at a tender age, Lazarillo learns that life is a hard taskmaster. However, he also learns that he can thrive by manipulating human frailties to his own advantage.
In the novel, Lazarillo is apprenticed to a blind beggar after his stepfather's violent demise. It is during his apprenticeship that Lazarillo begins to learn the tools of survival. Even though the beggar is cruelly abusive to Lazarillo (both physically and mentally), he is an extremely resourceful man; he is able to thrive by leveraging his knowledge of herbal medicine and natural remedies to solve "toothaches, fainting spells, and female illnesses." So, despite his disability, the blind beggar is able to earn more "in a month than a hundred ordinary blind men earn in a year."
From him, Lazarillo learns how to transcend cruelty and to thrive; when his master deprives him of food, Lazarillo uses artifice and subterfuge to outwit the older man. Lazarillo stays with his cruel master for a short time and learns useful skills; he endures terrible abuse but learns how to leverage duplicity to gain the advantage in hopeless circumstances. When he eventually decides to leave his master, Lazarillo does so with a diabolical flourish. He tricks his master into running towards a stone pillar in his efforts to avoid the widest part of a ditch.
Because he cannot see the pillar, the blind beggar crashes headlong into it and fatally splits his skull. Immediately after the beggar falls, Lazarillo makes his getaway. Lazarillo's future masters are members of the clergy: a squire, a pardoner, a priest, a friar, a chaplain, and an arch-priest. Although some of the clergymen equal in hypocrisy and corruption to Lazarillo's first master, others like the chaplain and the arch-priest of San Salvador are benevolent mentors. For example, Lazarillo suffers under the priest's rule: he only gets to eat during funerals. At all other times, he must endure debilitating hunger. Lazarillo continues in this vein until he manages to steal bread from the priest's locked chest. Hunger becomes an impetus for action.
And I think that hunger lit up my path to these black solutions: they say that hunger sharpens your wits and that stuffing yourself dulls them, and that's just the way it worked with me.
Yet, it is through the arch-priest's kindness that Lazarillo begins to experience some semblance of happiness in life. Although that happiness is implied to be a dubious one (Lazarillo's wife is rumored to have had a past, sexually intimate relationship with the arch-priest), Lazarillo benefits greatly from his ability to compartmentalize his life and to ignore unpleasant realities. His coping skills help him endure existing dysfunction in his life.
As for whether Lazarillo is a pessimist or an optimist, I would argue that Lazarillo is an optimist of sorts. Although he has endured great cruelty in life, he chooses to survive and to transcend past miseries. When rumors of his wife's past dalliances with the arch-priest of San Salvador accost him, he chooses to believe the best of his wife. Lazarillo decides to be thankful for his blessings, however unpleasant the rumors are.