Find solution for the boundary value problem: 
(((d^2) y (x))/(dx^2)) + 4 y (x)=0, 
with y (0) = 1, y (1) = 0. 
\(Discretize\ the\ differential\ \(equations : 
Δ\) = 1\/n, 
    x\_i = i*Δ, 
    y\_i = y[x\_i]\)
\(\((y\_\(i + 1\) - 2  y\_i + y\_\(i - 1\))\)\/Δ\^2 + 4  y\_i = \ 
        0;\)
\(y\_i = \(y\_\(i + 1\) + y\_\(i - 1\)\)\/\(2 - 4  Δ\^2\)\)
Boundary conditions:
     (Subscript[y, 0]) = 0, (Subscript[y, n]) = 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[{n = 10, ϵ = 
          (10^(-6))}, Δ = (1/n); ψnew = 
        Table[1 + (i - 
                  1)*Δ (1 - (i - 
                        1)*Δ), {i, 1, 
            n + 1}]; 
x0 = 
        Table[(i - 1)*Δ, {i, 1, n + 1}]; 
      Label[start]; ψold = 
        Table[ψnew[[i]], {i, 1, n + 1}]; 
Do[
        If[1 < i < n + 1, 
          temp[i] = (((ψold[[i + 1]] + ψold[[i - 1]]))/(2 - 4  (Δ^2))), temp[i] = ψold[[i]]], {i, 
          1, n + 1}]; ψnew = 
        Table[temp[i], {i, 1, n + 1}]; Δψ = 
        Table[Abs[(ψold[[i]] - ψnew[[i]])], {i, 1, 
            n + 1}]; 
      If[Max[Δψ] ≥ ϵ, Goto[start]]; 
      plot1 = Plot[Evaluate[y[x] /. sol1[[1]]], {x, 0, 1}, 
          PlotRange -> All]; data = Transpose[{x0, ψnew}]; 
      plot2 = ListPlot[data]; Show[plot1, plot2];]