Enable cheats in your world
Open the chat window
Type `/give @p command_block`
Place the command block on the ground
Right-click or tap the command block to open it
Enter a command in the command input box
Choose the command block type if needed
Set the redstone mode if needed
Power the command block with redstone
Use a button, lever, pressure plate, or redstone signal to activate it
Test the command
Adjust the command if it does not work
Use `/setblock`, `/give`, `/tp`, `/summon`, or `/effect` for common commands
Chain command blocks together if needed
Use repeating command blocks for continuous actions
Save and copy your setup if needed
