This tutorial assuming you are going to create a project using JSP + Servlet + Javabeans
Starting:
- Open Netbeans.
Creating a project (if you do not have one yet or you wish to have a new one):- File > New Project. "New Project" window appears.
- In the "Choose Project" step, choose Java Web > Web Application. Click Next.
- In the "Name and Location" step, enter your "Project Name". In this case, we use 'MyServlet'. You may locate your Project Location & Project Folder. We are going to use the default. Click Next.
- In the "Server and Settings" step, choose your Apache Tomcat server. I'm going to use 'Java EE 5' for "Java EE version".
- We are not going to use any "Frameworks". Just click Finish.
Your project will be created and opened. See that in "Projects" window.
Creating a servlet file:- In the "Project" window, right click your project name node. In our case, it is 'MyServlet'. Choose New > Servlet. "New Servlet" window appears.
- It is directly goes to second step which is "Name and Location". Put yours. We are going to use 'MyServletFile'. Click Next.
- Leave the default settings in the "Configure Servlet Deployment". Click Finish.
There goes your 1st servlet file. Refer image below:

You may see default servlet code template readily created for you.

(Click for larger view)
You may do stuff in servlet. Compile & run it.
My reference(s):
Java Servlet - Re: how can i run servlet in netbeans