Updated:

1. Go to diamond level

/tp @s ~ -58 ~

Since 1.18 diamonds are most common around Y -58 to -59. Dig out some space first, as you arrive inside solid rock.

2. Remove stone, keep ores (Java)

/fill ~-15 ~-6 ~-15 ~15 ~6 ~15 air replace #minecraft:base_stone_overworld

This clears stone, deepslate, tuff, granite, diorite and andesite in a 31x13x31 area. Ores, dirt and gravel stay. One /fill is limited to 32768 blocks.

3. Bedrock Edition

/fill ~-15 ~-6 ~-15 ~15 ~6 ~15 air replace deepslate
/fill ~-15 ~-6 ~-15 ~15 ~6 ~15 air replace tuff

Bedrock has no block tags, so run one command per block type.

4. Look through walls

/gamemode spectator @s

Spectators pass through blocks. Note the coordinates, then return with /gamemode survival.

5. Add night vision

/effect give @s night_vision infinite 0 true

See the night vision command. Fly in creative after clearing, since the area becomes hollow.

6. Ancient debris in the Nether (Java)

/fill ~-15 ~-6 ~-15 ~15 ~6 ~15 air replace #minecraft:base_stone_nether

Ancient debris is most common around Y 15. Clearing netherrack, basalt and blackstone there exposes it. Add fire resistance first, as the Nether is full of lava.

Troubleshooting

Check your command

The Command Error Doctor checks common syntax mistakes in your browser.