To prevent a ti plant from getting leggy, provide it with adequate sunlight. Place the plant in a location that receives bright, indirect light for several hours each day. Avoid placing it in a spot with low light conditions as this can cause the plant to stretch and become leggy. Additionally, regular pruning of any leggy growth will help maintain a compact and bushy appearance.