Umm - no - that's not how this works at all - it looks like you're confusing different kinds of visas.
If a US-based company want's to employ you and have you move over to the USA, then that company has to apply for an H-1B visa on your behalf.
You, as the foreigner who wants to come to the USA, cannot apply for this visa yourself.
I suspect that your confusion comes from 2 different visa 'lotteries'.
The first one, which really is much like a lottery, is the "Green Card Lottery", more correctly called the Electronic Diversity Lottery.
This is something you can apply for yourself, and it is an annual lottery in that the 'winners' are randomly drawn once yearly from the list of qualified applicants.
Winning a slot in this lottery will allow you to apply for a "Green Card" which, if successful, means that you could then move over to the USA without already having a job to go to.
But, as with most other lotteries, there are far more applicants than there are slots allocated for winners, so this is certainly not something you should bank on getting.
For the second - sometimes the H-1B process is informally referred to as a lottery, but it isn't really.
Your likelihood of being granted an H-1B visa depends on whether or not you and the sponsoring company qualify (simplistically in terms of the nature of the job and whether or not there are qualified Americans available), as well as other factors (like have the limited number of H-1B visas for this year already been issued).
The company which wishes to employ you (your sponsor) must first apply to the US Dept of Labor for a determination that the position they're looking to fill cannot reasonably be filled by someone already legally resident in the USA. Your sponsor has to have already advertised locally and not received any suitable responses, and must also be paying no less than "the going rate" for the job.
If this is granted then they have to apply to US Immigration for a visa on your behalf, and if this is successful you will be required to attend an interview at your nearest US Consulate or Embassy, where the final decision will be taken and your visa issued.
These steps are often carried out with the oversight and assistance of a US-based immigration attorney, and the costs to the sponsor are not insignificant.
However, if your sponsor does choose to go down this route, these costs are not your concern since they are legally prevented from making any attempt to reclaim them from you (at least directly anyway - there are ways to add things like early-termination clauses to employment contracts which might have you pay some penalties for leaving the position 'early').