First you do /Give @p minecraft:command_block then you make sure your in creative if you want to place it and use it in game! Thats All!