You get it from the IRS, directly and for free. For a US-based owner it takes one online session and the number is issued on screen the moment the application is approved.
The IRS is blunt about the part most search results skip. Its EIN page says "You never have to pay a fee for an EIN," and warns: "Beware of websites that charge for an EIN." Any charge you see is for someone filling in the form for you, not for the number.
Get the order right first. The IRS tells LLCs to form the entity with the Secretary of State before applying, and says an application sent before the LLC exists may be delayed. So wait until the state approves your LLC, then apply using the exact legal name on your approved filing.
The online application is for you if the LLC was formed in the US, its principal place of business is in the US, and the responsible party (the person who actually controls the company) has a Social Security number or an ITIN. It has to be completed in one sitting: it cannot be saved, and it expires after 15 minutes of inactivity. It is also not open around the clock. The hours, Eastern Time, are Monday to Friday 6:00 a.m. to 1:00 a.m. the next day, Saturday 6:00 a.m. to 9:00 p.m., and Sunday 6:00 p.m. to midnight. Print the confirmation letter at the end.
If you live outside the US and your principal place of business is abroad, you cannot use the online tool. The IRS route is a phone call to 267-941-1099, Monday to Friday, 6 a.m. to 11 p.m. Eastern (not a toll-free number), or Form SS-4 by fax to 304-707-9471 from outside the US (855-215-1627 from inside it), or by mail to Internal Revenue Service, Attn: EIN International Operation, Cincinnati, OH 45999. For domestic mailed applications the IRS says to expect the number in about four weeks.
Three rules catch people. First, you can only get one EIN per responsible party per day, whichever channel you use. Second, the application has to name the real responsible party: the IRS says nominees are not authorized to apply. Third, a brand new number works right away for opening a bank account or applying for licenses, but the IRS says to allow up to two weeks before it passes TIN matching or works for e-filing and electronic tax payments.
On whether you need one at all: a multi-member LLC does. For a single-member LLC, the IRS says one with no employees and no excise tax liability does not strictly need an EIN for federal tax purposes. It also says "most new single-member LLCs" will need one in practice, and that an LLC can get one when a bank requires it to open an account. That is the case for almost everyone.