Every CPU is a little bit different, you'll find out whether or not you've won the "Die lottery" once you test your specific chip.
That being said, 4.0 GHz on the FX-6300 is not a difficult overclock, especially if you have an aftermarket cooler.
First things first, make sure you don't get carried away and are carefully monitoring your temps as you test your overclock. You could end up frying something if you get overly ambitious.
I suggest downloading AIDA64 to keep track of your temps and run a stress test. You can get a free trial version from the developers website here:
http://www.aida64.com/downloads
Install that, and then reboot your computer and launch into the BIOS settings. I'm not sure what the bios looks like for your particular model, but you'll need to find something like "Base clock multiplier" or "Base clock" or even "BCLK" and change it from (what should be) 35 to 40.
After that, boot into windows and run AIDA64 for a few hours (preferrably overnight) if the computer hasn't crashed, or your temperatures aren't reaching past a certain threshold, (I'd suggest shooting for 75C or below) then you're in the clear!
If your computer crashed, then you'll need to go back into the BIOS settings and increase the VCORE (or Voltage Core) slightly, then run the same test again. I suggest increasing this by increments of 0.025V each time until you reach a stable overclock/heat target.
Your goal with overclocking is to hit a sweet spot where you can increase the base clock multiplier by a lot without having to really ramp up the voltage, as higher voltages generate a lot of heat and could potentially damage your processor in the long run (or even immediately!)
As some final words in case you get lost, remember that the stock settings for your CPU are a 3.5GHz base clock (35 base clock multiplier) and your stock voltage is 1.35V (VCORE) if you need to start over from the beginning, make sure that these settings are the same!
If you have any more questions, just let me know!