The Diversity Visa Program (sometimes called the Diversity Visa Lottery) is a U.S. Department of State program that makes 50,000 legal permanent resident (green card) visas available each year to nationals from countries which the U.S. considers to be under-represented in U.S. immigration. Anyone who is not from an excluded country can apply. Some restrictions may apply, so please read the information carefully.
NOTE: Having your application chosen from the yearly lottery does not mean you'll be automatically granted residency. It only means you are now eligible to apply for residency which takes many months, has fees attached, and is best handled for you by an immigration attorney.
The first step is free and the official application is found on the U.S. Department of State website. Start by determining your eligibility by country.