You can not get command blocks in-game. Instead, spawn them in with /give USERNAME 137 quantity
To use command blocks, you need to know basic commands.
For example, let's say you want to change or add time. To do this, use your build block button and click on the command block.
When there, type in /time set 0 (or whatever command you want)
Afterwards, make a redstone signal (buttons or pressure plates are the best) and click and it should do the command. Hopefully this helped, and if you need more help read this: