I would recommend to go through Partial Differential Equations for Scientists and Engineers by Stanley J. Farlow textbook for more details on mathematical solution.
If you need numerical solutions to be coded, try Numerical recipes by Cambridge press.
I am sending you one 1D heat conduction problem I had solved long before with MATLAB code. Just solve the system of equations (represented using matrix on page 3 of my attachment) using any one of Gauss elimination, Gauss-seidel or Gauss-jacobi method. The codes I am sending you are generalised programs and can handle any problem when given appropriate inputs. Note that for using Gauss-seidel or Gauss-jacobi method method, the coefficient matrix must be a diagonal dominant matrix. If the matrix is a diagonal matrix, always prefer Gauss-seidel method, because it gives the best approximation to the solutions.you can also check this book.