The main thing is to just make sure you are going straight and not at an angle. If you are going straight, you can make straight path really easily. If you are having trouble, I'd recommend doing a 1 wide 2-3 high path first. Going straight with a 1 wide path is very easy. You can then widen it and make it taller once you've gone as far as you're going to go. Stick to 1 wide paths as you expand to keep it as easy as possible. If you damage something, I'd recommend just using the repair tool to fix it. You'll have the resources to do the repair since you're mining those same resources.
If you do break something, you can put in a terrain block if you want. Dirt can be done from inventory and is usually good enough, but if you really want it to look the same and are in stone, you'll need some stone blocks. If you don't need it to look like a dirt/stone tunnel and want it to have actual building blocks of wood, cobblestone, concrete, or steel, then you can also just fill in any holes with building blocks. I'll usually do this and will upgrade them to at least cobblestone just for a little extra strength, but that's not really necessary since nothing is likely to target them.
I dug a tunnel that was about 1km long all the way through a mountain and made it big enough to drive a 4x4 through with building blocks on floor, walls, and ceiling. It takes time, but can definitely be done. I also once dug a tunnel through a smaller hill (a few hundred meters or so) and wasn't paying attention and did it at an angle. That still worked, but I had to spend a lot of time using a variety of angle blocks to make the walls appear straight. I don't recommend that and suggest being very sure you're going straight. You can drop a block now and then to verify it is straight if needed.