How do I apply for an E-2 visa?

It depends if you apply while in the US or not. 
(a)    Outside the United States:
Apply at the U.S. consulate of your place of nationality. The application is done through the DOS Online Visa Application. See link for details on what the process of applying for a visa entails:

(b)    Inside the United States:
You must be in lawful nonimmigrant status.  For more detailed instructions on filing with the USCIS, the link is: