If you're new to gun ownership, I'd recommend taking a safety class first, preferably one that will let you try different guns during the practical portion of the class. If you're comfortable with a defense caliber right away, go ahead and buy one. If you're new to guns period, a revolver is a simple, user-friendly choice for a first gun. If you are comfortable with autos, enjoy them and don't mind practicing enough to stay proficient, don't assume you have to stick with a revolver.
Most people never take any training. But most people aren't too smart about it either. In addition to a safety course, a basic marksmanship course is a good way to see that you develop good habits right away. Practice in the basics is crucial. Defense caliber ammo is expensive. Because .22 is so inexpensive, you can practice a lot for just a little money.
You might also consider buying a (good) used gun from a reputable dealer, especially if you feel you need that defense gun right away.