Solution 1:

You can't turn blocks invisible. You could use a workaround such as giving the player blindness or setting the blocks around them to black concrete (It's fairly close to pure black) but there's no way to make blocks invisible other than breaking them.

You might be able to make all opaque blocks black by referencing this video, but this is most likely a bug and might be fixed in future versions.