Vertically aligning footer to bottom

I’m wanting to align my footer to the bottom of my web page so that it is always at the bottom of the window, but if the content on the page is too great to fit into one page the footer moves to below it.

I’m sure somebody had this problem before and I think they found a solution, but I couldn’t find what I was looking for when I searched.

I have tried this out and the solution is not position: fixed; bottom: 0; because when you try this and the content is too great to fit into the page the footer sits on top of the content.

Thanks.