How to disable spotlight for Alfred I use Alfred instead of spotlight but sometimes I accidentally press cmd + space( Spotlight Shortcut ) instead of double shift( Alfred Shortcut ). I want to disable Spotlight( shortcut + not run it in background as well )  so might not open it. Also, does Alfred use spotlight file indexing if yes then I might not want to disable that but if no I would like to disable that as well.
In the "System Preferences" app select "Spotlight" from the top row. Now, uncheck the box titled "Spotlight search keyboard shortcut:"

I set the Alfred keyboard shortcut to Command-Space, which works a bit like Alfred on stock Yosemite machines.

If you want to keep the ability to search Spotlight with a keyboard shortcut, you could also change the shortcut using the popup menu to the right of the checkbox.