Example 1

f[x_,y_] = 4-y^2 - x^2

surface=Plot3D[f[x,y],{x,-2,2},{y,-2,2},ColorFunction->"BlueGreenYellow",MeshStyle->{Red},Boxed->False,Axes->False,PlotPoints->20,PlotStyle-> Opacity[0.9]]

pfy[x_,y_]=(∂_y)f[x,y]
pfx[x_,y_]=(∂_x)f[x,y]

linex[a_,b_] := ParametricPlot3D[{a,t,f[a,b]+pfy[a,b](t-b)},{t,-15,15},Boxed->False,Axes->False,PlotStyle->{Blue,Thick}]
liney[a_,b_] := ParametricPlot3D[{t,b,f[a,b]+pfx[a,b](t-a)},{t,-15,15},Boxed->False,Axes->False,PlotStyle->{Blue,Thick}]

Show[surface,liney[-2+4/19*15,-2+4/19*5],linex[-2+4/19*15,-2+4/19*5],PlotRange->{{-2.3,2.3},{-2.3,2.3},{-2,4}},AspectRatio->1,ViewPoint->{1.3,-2.4,1},Axes->True,Boxed->True,AxesLabel->{x,y,z}]

Manipulate[Show[surface,liney[-2+4/19*15,k],linex[-2+4/19*15,k],PlotRange->{{-2.3,2.3},{-2.3,2.3},{-2,4}},AspectRatio->1,DisplayFunction->$DisplayFunction,ViewPoint->{1.3,-2.4,1}],{k,-2,2,4/19}]

Manipulate[Show[surface,liney[k,-2+4/19*7],linex[k,-2+4/19*7],PlotRange->{{-2.3,2.3},{-2.3,2.3},{-1,4}},AspectRatio->1,DisplayFunction->$DisplayFunction,ViewPoint->{1.3,-2.4,1}],{k,-2,2,4/19}]

Example 2

f[x_,y_] = Cos[x]Sin[y]

surface=Plot3D[f[x,y],{x,-4,4},{y,-4,4},ColorFunction->"BlueGreenYellow",MeshStyle->{Red},Boxed->False,Axes->False,PlotPoints->20,PlotStyle-> Opacity[0.9]]

pfy[x_,y_]=(∂_y)f[x,y]
pfx[x_,y_]=(∂_x)f[x,y]

linex[a_,b_] := ParametricPlot3D[{a,t,f[a,b]+pfy[a,b](t-b)+0.01},{t,-15,15},Boxed->False,Axes->False,PlotStyle->{Blue,Thick}]
liney[a_,b_] := ParametricPlot3D[{t,b,f[a,b]+pfx[a,b](t-a)+0.01},{t,-15,15},Boxed->False,Axes->False,PlotStyle->{Blue,Thick}]

Show[surface,liney[-4+8/19*11,-4+8/19*11],linex[-4+8/19*11,-4+8/19*11],PlotRange->{{-4.3,4.3},{-4.3,4.3},{-1.3,1.3}},AspectRatio->1,ViewPoint->{1.3,-2.4,1},Axes->True,Boxed->True,AxesLabel->{x,y,z}]

Manipulate[Show[surface,liney[-4+8/19*2,k],linex[-4+8/19*2,k],PlotRange->{{-4.3,4.3},{-4.3,4.3},{-1.3,1.3}},AspectRatio->1,ViewPoint->{1.3,-2.4,1}],{k,-4,4,8/19}]

Manipulate[Show[surface,liney[k,-4+8/19*5],linex[k,-4+8/19*5],PlotRange->{{-4.3,4.3},{-4.3,4.3},{-1.3,1.3}},AspectRatio->1,ViewPoint->{1.3,-2.4,1}],{k,-4,4,8/19}]