Pay your bills on time. No brainer there but the surest way to quickly get bad credit is to miss a payment or be late.
Don’t go near the max. Your maximum credit limit that is. Try to keep your debt below 20-25% of the credit that is available for you. Your debt to available credit ratio is crucial.
Don’t apply for or get more credit than you need. Even though you must have credit in order to establish credit, using credit is like eating sugar, you should only partake rarely and sparingly.