Companies that have no debt cannot go bankrupt. Look for debt free or below-average debt-to-equity ratios. Avoid highly over-geared; a company with low equity and high debt. During bad times such companies may face difficulties in servicing debts. Market rewards companies with little or no debt while punishing those who piled up large debt on their books.
Before you purchase a company's stock be sure to check their ratios.
If you want to learn more, check out these resources: