If you don't have transportation, Edinburgh Crystal operates a shuttle bus service to and from the center of Edinburgh.
You can take a shuttle bus to Edinburgh Castle. 
There are no buses to Edunburgh Castle. 