Q:

How can I get a US Greencard through the Diversity Visa Program?

How can I win a resident visa through the Greencard Lottery? Should I go to a US Embassy or can I apply online?

A:

The Diversity Visa Program (aka Green Card Lottery) is currently closed. When it is open you must apply online. Information can be found at the US Dept of State

Entries for the DV-2015 DV program must be submitted electronically at www.dvlottery.state.gov
  between noon, Eastern Daylight Time (EDT) (GMT-4), Tuesday, October 1, 2013, and noon, Eastern
  Daylight Time (EDT) (GMT-4), Saturday, November 2, 2013. Do not wait until the last week of the
  registration period to enter, as heavy demand may result in website delays. No late entries or paper
  entries will be accepted. The law allows only one entry by or for each person during each registration
  period. The Department of State uses sophisticated technology to detect multiple entries. If you submit
  more than one entry you will be disqualified.

A:

In order to win you have to play.  The US Diversity Lottery applications are only electronic and are open for a short period of time.
You can read the instructions for DV-2015 or go DV Lottery Entrance Website.  The DV-2016 applications will be available no earlier then October 1, 2014.

