If you accidentally press the shaft lock button while using your Dremel then you'll wear out the locking pin, so don't do it!
But in case you have here are the spare parts to fix it. Just take apart your Dremel tool with a Torx driver and you'll easily see what needs replacing.
FOR DREMEL 3000
1 x Shaft lock pin
1 x Spring
The sets for the Dremel models 300 and the newer 3000 look very similar but are actually slightly different, see below.
Lock pin diameter 2.62mm*
Lock pin overall length 10.52mm
Spring diameter 15mm
Spring hole diameter 2.62mm
* The difference is the size of the pin that goes into the hole in the shaft. The Dremel 300 is 2.42mm and on the Dremel 3000 it's 2.62mm. Please make sure you choose the right part because even though the difference is small the pin may not fit the hole in the shaft or be too sloppy.