First you have to earn it by driving safely and making no any claims to your insurance company. Once if you pass first year that will become your one year no claim bonus as the years will pass they be added on top of your previous no claim bonus years. But do not forget the point here that you have to drive safely and make no claims throughout within that time period.
Another question, once if you get it, is there anyway to save it? Yes there are two ways.
1. If you have money and are very concerned about saving your no claim bonus, then you can secure it by paying slight extra money on top of your regular premium. Some companies protect it, even if it is your fault in an accident, depending on the policy of the company.
2. Other way to save your no claim bonus is, that you do not want to spend extra money and trust on your driving and would like to keep it as it is. But there is a risk, if you get involved in an accident you have to make a tough decision


"No Claim Bonus" is also known as "No Claim Discount" in some insurance companies.