We will consider how to solve numerically problems where we have a $2^{nd}$ order ODE governing equation, but information only about the state at the boundaries.
$$ y''=f(x,y,y'),~~~y(a)=y_a,~~~y(b)=y_b $$
First, we transform the ODE by substituting finite differences for derivatives.
$$
y''=f(x,y,y')~\Rarr~\frac{y_{i+1}-2y_i+y_{i-1}}{h^2}
=f(x,y_i,\frac{y_{i+1}-y_{i-1}}{2h})
$$
Next, we apply a mesh across our domain, with nodes separated by $h$. We may then apply this finite difference form of the ODE at every node. Constructing these constraints into a matrix gives a linear system for the values at all nodes.
Consider the following example with a three node mesh.
Governing ODE
$$ a_0+a_1y+a_2y'+y''=0 $$
Finite Difference ODE
$$ a_0+a_1y_i+a_2\frac{y_{i+1}-y_{i-1}}{2h}+\frac{y_{i+1}-2y_i+y_{i-1}}{h^2}=0 $$
$$ (-\frac{a_2}{2h}+\frac{1}{h^2})y_{i-1}+(a_1-\frac{2}{h^2})y_i+(\frac{a_2}{2h}+\frac{1}{h^2})y_{i+1}=-a_0 $$
Linear System for Value at all Nodes
$$ \begin{bmatrix} 1&0&0\\ -\frac{a_2}{2h}+\frac{1}{h^2}&a_1-\frac{2}{h^2}&\frac{a_2}{2h}+\frac{1}{h^2}\\ 0&0&1 \end{bmatrix} \begin{bmatrix} y_0\\y_1\\y_2\\ \end{bmatrix} =\begin{bmatrix} y_a\\-a_0\\y_b\\ \end{bmatrix} $$