When it comes to lightning, you want to disengage using autofocus. This is because the lightning will easily fool the autofocus sensor. Set manual focus and change the lens to infinity. Setting the lens to infinity gives maximum depth on the field. It does make objects close to the camera out of focus, but they are not your targeted subject, so it is okay.
Lightning brings rain and it is better to shoot from a safe place, but it is not always possible. You have to protect your lenses and camera from the rain to not mess with the mechanics of the camera. Always use a lens filter to protect the lens and wipe away rain droplets from the lens with a soft lint-free cloth. Use a protective plastic case that will protect the lens, camera, and top half of the tripod. Avoid changing your lens in the rain and keep all your camera accessories in a closed bag.
Shooting a streak of lightning looks amazing, but it does not tell us anything else from the picture. Create a setup and include the background and surrounding area in the picture. Use a wide-angle lens and think about how the image has been composed. Add other elements like a house, road, etc to tell a story from your picture.
If you are attempting to capture lightning with a specific object (in this case the tree), then you need to keep the tree in focus first. Use a sturdy tripod to avoid shaking the camera and use a remote release device so your camera does not have any vibrations when releasing the shutter. Set the f-stop between f/5.6 to f/8 and set the shutter speed to B “bulb” mode.
For the best shot of lightning bolts, it's best to use a tripod. It helps stabilize your camera for a better and clearer shot. While some photographers may be able to get away with using a handheld camera to get their shots of this beautiful natural phenomenon, using a tripod will better your chances of getting a good photograph on your first try. Lightning doesn't usually come back if you get a shaky picture. Give yourself the best chance to get a great shot by using a tripod.
Before you focus on the photography aspect of lightning, you have to make sure you are keeping yourself safe. The first thing you have to do is find a safe spot from which you can photograph the lightning. You should not be taking pictures of lightning in an open area near trees or water. The safest place to be when taking these types of pictures is inside a building or a car. Remember, if you can see the lightning, it is close enough to strike in your vicinity.