The US ESTA is a travel authorization which must be completed by people who are citizens of countries that participate in the Visa Waiver Program. This process is a pre-authorization, which checks that a person is allowed to travel to the United States, and it applies to tourists and business travelers who are looking to fly (or otherwise travel to) the country.
It is not a Visa, although many people talk about it as if it was, because the typical leisure traveler from somewhere such as the United Kingdom does not need a Visa, so to them the ESTA fills the same role. There is a distinction, however, and it can be important for longer stays or for those who want to work while they are in the country.
If you would like to apply for a US ESTA, then you should visit the government website and fill out the forms online. You can do so at any point, although the earlier before your trip you do it, the better, just in case there are delays. The form is quite simple and most people will have a response back in their email account within a few hours at most. If there are any delays then you may be contacted for more information.
Do not use third-party sites to apply for your ESTA. At best, those sites may turn out to be a waste of money, since they are not associated with the government and do not have the ability to help you get your application processed more quickly. At worst, they could be a front for credit card fraud or identity theft. Stick to the .gov website to ensure that you get safe, secure service and that the only people who see your data are the people who actually need to see it.