Let [tex]k:y=m_1x+b_1[/tex] and [tex]l:y=m_2x+b_2[/tex]
[tex]l\ \perp\ k\iff m_1m_2=-1\to m_2=-\dfrac{1}{m_1}[/tex]
We have
[tex]y=-x-2\to m_1=-1[/tex]
Therefore
[tex]m_2=-\dfrac{1}{-1}=1[/tex]
We have the equation of a line:
[tex]y=-1x+b\to y=-x+b[/tex]
Put the coordinates of the point (-2, 4) to the equation of a line:
[tex]4=-(-2)+b[/tex]
[tex]4=2+b[/tex] subtract 2 from both sides
[tex]2=b\to b=2[/tex]