Light Yagami's relationship with L and Near greatly influences his actions and decisions throughout the series "Death Note." Initially, Light sees L as a formidable adversary, which drives him to become more cunning and strategic in his approach to outsmart L. As the cat-and-mouse game between Light and L intensifies, Light's obsession with defeating L leads him to take increasingly extreme measures to cover his tracks and maintain his facade as an innocent and helpful member of the investigation team.
After L's death and Near's introduction, Light's dynamic with Near is different but still impactful. Near's similar deductive abilities to L challenge Light in a different way, pushing him to adapt his tactics and strategies. Light's interactions with Near lead to further escalation in his ruthlessness and desperation to eliminate any threats to his plans of becoming the god-like figure Kira.
In summary, Light's relationships with L and Near shape his actions and decisions by fueling his drive to outsmart them, leading to a spiral of manipulation, deception, and moral decay as he seeks to maintain his power and control.