The finite element method (FEM) is undoubtedly the established procedure for solving problems in solid mechanics. This courses gives a thorough introduction to the finite element method. For a simple 1D bar in elastostatics equilibrium, we derive the variational formulation and work out the resulting finite element discrete system of equations. This is then generalized to higher dimensions and other problems. We also look at the p-version of the finite element method (p-FEM). For these methodologies, we look at a priori and a posteriori error estimates that help us understand the convergence properties.