I have owned the D300 for a number of years and this camera should certainly give you decent images. The most likely reason you are not happy with what it produced in your 'first' few shots with it is operator error. There is of course the slight chance that you have a camera or lens fault but you should not even consider that yet.
The D300 has numerous user selections and there's a good chance that as this was a used purchase things are not set up for the type of test you gave it.
I would suggest you undertake the following;
Fit your Nikon 50mm 1.8 Set the camera to 'Manual' Set to Manual focus Set to Matrix metering Select ISO 200 Select Auto White balance Select a pic quality of Raw + Fine(jpeg) Select an aperature around F8 to F11 (approx sweet spot for this lens)
If you have a tripod definitely use this and set up to take some test shots outside consisting of subjects that are going to demonstrate picture detail quality rather than composition.
Select your shutter speed using the cameras internal meter in the viewfinder. Manually focus
Having taken a few shots view these on your computer. Hopefully the quality will be fine proving that your equipment is ok. If this is the case you then know it's just a matter of learning and technique !
Let us know how you get on with the test. Regards, Grahame