New firearms need to be broken in, and it is advisable to do so before you start carrying the firearm as an everyday carry pistol. It is very uncommon, however firearms can come from the factory with a defect. So it is highly advisable to break the firearm in before relying on it in defense of your life. Some firearms need to be broken in in order to hit their “peak” in terms of accuracy as well.
The break-in period for most handguns will be around 1,000 rounds. Some may be a bit higher, but with a thousand rounds through I will carry the firearm as an everyday carry pistol. I see a lot of people buy a new pistol, never fire it and start carrying it as a defense pistol. I do not recommend this due to the fact that I have seen on numerous occasions brand new pistols having issues detrimental to the operation of the firearm. The range is the time to find out your pistol has an issue, not when you are relying on it to save your life.
Function testing is another important factor as well, and this goes for any modifications or changes you make to your loadout. Ammunition is one that I see people skip the most. Some firearms will function with any ammo you throw at it; some however don’t like certain ammunition. Again, a self-defense situation is not the time to find out that your firearm doesn’t like the ammo you purchased and decided to carry. If you are going to change the ammo you are going to carry for self-defense, you should put a minimum of 50 rounds of that ammo through your firearm at the range before you decide to carry it for personal defense.
As for modifications, first and foremost refer to your manufacturer’s manual as any modification can potentially void any warranty you may have on it. The same concept applies for function testing however, especially if you are doing the modification yourself and not having a licensed gunsmith do the work. If you accidentally put something in wrong, or assemble something the wrong way and your firearm subsequently will not function; the time to figure that out is at the range, not in defense of your life.
There are parts that can be put in wrong or assembled wrong, or parts for another similar firearm can potentially fit but can hinder the functionality of the firearm or cause it to not fire at all. Great example: I just had somebody bring in a Glock 23 that would not fire because they had used the rear coupler of the striker from a Glock 42. The part looked the same, but was slightly shorter than the proper Glock 23 coupler. If you do not have a substantial amount of experience I would advise allowing a licensed gunsmith do any modification on your firearm.