What did President Andrew Jackson do that almost got him impeached?

It is not true that President Andrew Jackson was almost impeached. You are thinking of Johnson, not Jackson. And in Johnson's case, it was a complicated matter of post Civil War politics. Some people thought that Johnson, a southerner, should not be allowed to succeed Lincoln following the assassination of Lincoln.