How do you train in a jutsu that kills you if used? For example, Guy Sensei and Rock Lee can use the Eight Gates technique. If the last gate is opened, you die.

There is a lot of emphasis in the series that shows that one must train very hard to perfect a jutsu, technique, etc.

But how do you train and perfect something that you can only do once... and then just die?
It's like jumping off a building.

You can jump from the first, second or third floor and survive. The method to reach all the floors remains the same (Climbing by stairs... or you may call this training.).

However, after a certain number of floors, you will come to a realization that after you jump through this floor (let's just say the 20th -- you need not practice climbing 20 floors for this -- the experience of climbing one floor is just fine), you will become extinct.

You don't need the experience nor practice to reach the 20th floor but you will surely become extinct if you jump from there.