If you've gone through a bankruptcy or foreclosure, you can still get another mortgage, but it will take time and effort.