1. Don’t go bankrupt

I guess the most obvious one is saved until last. Filing for bankruptcy is an immediate and catastrophic way to negatively impact your credit rating, and what’s worse is that it can stay on your file for around ten years. Most mortgage companies and car finance places will automatically reject any application for credit from anyone with a history of bankruptcy, even if things have started to slowly improve over time.
The best advice if bankruptcy is your only option, is to slowly but surely build up your credit rating, paying off all bills on time with no excuses, and from there, obtain small credit which you can pay off on time, keeping it below reasonable levels and eventually get rid of them all together. This process will unfortunately take years.