What settings would I have to use? I had it for a few weeks so I'm getting the hang of it, but so far I'm going to shoot portraits in ISO 200 + RAW format. I need it so its crystal clear, is there anything else I need to change?
Setting? Well first and foremost pay close attention to focus. For people and animas focus on the
eyes. Not the nose or forehead, the eyes. If you simply aim the camera in the general direction and let it auto focus you don't really know what it is doing. So pay attention and work carefully. You may want to work from a tripod. This not many eliminate blur from camera shake but allows you to make fine adjustments to the camera location and aim point. Then you look, think and fine tune.
Give the subject some distance, use about the 50mm setting on the zoom and frame the scene by moving the tripod back and forward. Shoot with the aperture wide open and you might be able to reduce the depth of field a little. But likely you will need to have the subject far from any background, at least as far from the background at the camera to subject distance. Think about the lightness or darkness of the background relative the the subject's skin and hair color. Adjust the background lightness/darkness with lighting
Next is lighting. You want even, soft and low contrast lighting. Direct sunlight from a blue sky is the worst so is a directly aimed flash. So a window for light and hang a white sheet to act as a reflector. Lighting is important because the digital camera can only handle a small range in brightness, both shadows and highlights must fall inside this narrow range. The camera has a histogram display, take some test shots and look at the display. Your avatar is a good example of low contrast lighting. Notice there is good color and detail on both the lit and shadow sides of the face and the light is from a defuse, soft source.
If you have some money to spend you might look into what lens would be best. Your D40 will not auto focus some of the better fast primes. But if working with a cooperative subject and a tripod manual focus is easy. There are some f/2.8 zooms that would work well with your camera too. But mostly just worry about focus and lighting. The quality of the lens is not a big issue compared to focus and light
That's just some of the technical stuff. The other is things like getting a good expression, pose and background I'll leave to you. Just look at portraits you like and attempt to replicate the style.