If you already know what your nonprofit organization is doing, then you're already in good shape. You'll need to file articles of incorporation with the state you're registering in. A lot of states, like TX and CA, have nonprofit-specific forms that you can fill out online.
After you do that and the articles are approved, your next step is checking the state AG/SOS site for any other forms you need to file. The forms you need to file could be specific to what your organization is doing. So for example, a family foundation in CA will have to pay to register with the state AG's office, but if you're starting a church or some other religious organization, they are exempt from those filings.
You should also check your city or county if you need to register for any business licenses too.
Once you complete all the required supplemental filings, you should first write your organization's bylaws, including coming up with a conflict of interest policy. There's a lot of templates and examples online, and you can choose whichever one you like. A lot of foundations put theirs online too so you can use that as a reference.
Finally, the 1023 application – applying for tax-exempt 501(c)3s status. There are two main ways to apply – on paper, the 1023 application requires you to list all your financials to date and where you expect the nonprofit to be two or three years down the line. They also ask a lot of questions about the activity you will be engaging in. The turnaround time is typically around 4-6 months but could be longer with a more complicated application.
If you don't anticipate taking in more than $50k for each of the first 3 years, then you can apply for a 1023-EZ application on the IRS website. It's a two page, online application and you get a decision within a week and a half to two weeks. I do believe that a lot of 501(c)3s go over the 50k but I actually have not heard of the IRS revoking tax-exempt status for doing so. If you think you're going to be taking in above $50k in grants or donations, I would do the 1023 full application.
And make sure you file the form 990s every year! They are basically your organization's tax returns. Even though you may be tax-exempt, these filings are still important as they help the IRS determine if you are in compliance with all tax laws and failure to file can result in significant tax penalties.