How to earn badges
You earn a badge when you accomplish something. Each badge has got its meaning, and purpose.
Here is the list describing the badges with their meanings.
My suggestion, don’t run around to earn badges or rank. Just try to learn and help. Badges and better rank would be side product.