Usually any negative remarks that you have such as unpaid debt or other debt collection remarks will be removed 7 years after they were put on your credit report.
But it doesn't necessarily mean your credit rating will improve.
You'll need to do things to improve your credit score such as paying any loans back on time, not missing a mortgage payment or car payment etc.
When you do get your credit rating improved do everything you can to keep your credit rating up.