Find solution for the boundary value problem: 
(((d^2) y (x))/(dx^2)) + 4 y (x)=0, 
with y (0) = 1, y (1) = 0.

Off[General::spell];
Off[General::spell1]; ClearAll["Global`*"]

Analytic Solution

sol1 = 
      DSolve[{y''[x] + 4  y[x] == 0, y[0] == 1, 
          y[1] == 1}, y, x]

Plot[y[x] /. sol1[[1]], {x, 0, 1}]

Block[{ϵ = (10^(-6))}, Δ = 1/2; v0 = 0; 
      sol2  =  
        NDSolve[{y''[x] + 4  y[x] == 0, 
            y[0] == 1, y'[0] == v0}, y[x], {x, 0, 1}]; 
      y2old = Evaluate[y[x] /. sol2 /. x -> 1][[1]]; 
      v0 = v0 + Δ; Label[start]; 
      sol2  =  
        NDSolve[{y''[x] + 4  y[x] == 0, 
            y[0] == 1, y'[0] == v0}, y[x], {x, 0, 1}]; 
      y2new = Evaluate[y[x] /. sol2 /. 
              x -> 1][[1]]; 
If[(y2old - 
                1)*(y2new - 1) > 0, v0 = v0 + Δ; 
        y2old = y2new, Δ = Δ/2; 
        v0 = v0 - Δ]; 
      If[Abs[y2new - 1] ≥ ϵ, Goto[start]]; 
      Plot[Evaluate[y[x] /. sol2], {x, 0, 1}, PlotRange -> All]; 
      Print["y'[0]= ", N[v0]]]; 
    Plot[(y[x] /. sol1[[1]]) - (y[x] /. sol2[[1]]), {x, 0, 
        1}]