Minecraft cheating?

I was using the staircase method to mine down to 12 blocks from bedrock. I stop with the stairs and move in a straight line. The original reason I started mining was that I was at level 22 trying to get to 30 for enchantments. I died to lava because I had no stairs, but I don’t know how to stay at the same point 12 blocks from bedrock without dying to lava. I enabled cheats and changed keepinventory to true so I could level up.

Then, I realized you can just give enchantments with cheats. Now, I feel guilty from cheating and want to remove all cheats but then I would lose all of my diamond weapons because I cheated to enchant them. What can I do to safely mine diamonds, level up, and not cheat at all? Do I need to carry water in case there is lava? What do I do?