How to rename your command block

Raw code

minecraft:command_block{
  display: {
    Name: "[
      {
        \"text\":\"Custom Name\",
        \"color\":\"red\",
        \"italic\":false,
        \"bold\":false
      }
    ]"
  }
}

Compiled

/give @p minecraft:command_block{display:{Name:"[{\"text\":\"Custom Name\",\"color\":\"red\",\"italic\":false,\"bold\":false}]"}}
/give @p minecraft:command_block{display:{Name:"[{\"text\":\"Debug\",\"color\":\"yellow\",\"italic\":false,\"bold\":false}]"}}
/give @p minecraft:command_block{display:{Name:"[{\"text\":\"Success\",\"color\":\"green\",\"italic\":false,\"bold\":false}]"}}

With /setblock

/setblock ~ ~1 ~ minecraft:command_block{display:{Name:"[{\"text\":\"Error\",\"color\":\"red\",\"italic\":false,\"bold\":false}]"}}