Some suggested to get a 22 pistol for practice and get a same brand 9mm for carry.
That's good idea but now we have two guns and they are of same size so doesn't serve any purpose except cost.
Generally, this is well meaning advice, but poor advice all the same. The 22LR should be a target style, full size pistol like a Ruger Mark IV or S&W Victory, whereas your 9mm carry pistol should NOT be a single action only, full sized pistol.
The value of a target style 22LR cannot be exaggerated - I've taught hundreds of new handgunners over the last couple decades, and the few hundred dollars a new handgunner, or even experienced handgunner would spend on a Ruger Mark IV will absolutely pay for itself in terms of skill development and proficiency. My advice since the late 1990's has been thus:
Your first handgun should be TWO handguns - a target style 22LR and whatever other pistol you need/want for your application.
Unfortunately, what you describe as your desires - a carry pistol, a practice pistol, and a home defense pistol - really describes THREE pistols, not just 2. While a carry pistol can serve as a home defense, aka "nightstand gun," generally owners are better served to have a full sized pistol as the home defense pistol. Concealing something even as large as a Glock 19 or Sig P320 Subcompact is a challenge, double stack 9mm's just aren't very easily concealed in most daily wear for most American environments. Something along the lines of a Ruger LC9s, LCP, Glock 42 or 43, or Sig P365 are more easily concealed. But these micropistols make a lot of concessions for concealability which hinder their effectiveness in home defense. Equally, your home may need a defensive solution even if you're not there - an LCP in your pocket at the store doesn't help defend your wife and children sitting at home. If money is incredibly tight, then yes, you can do the job with 2, but I'd make an effort, in your shoes, to manipulate my purchase choices as well as extend my savings period to explore having 3 options, rather than simply 2.
If I were 1) in your shoes, 2) only buying 2 and not 3 pistols, and 3) trying to minimize my costs, I would own a Ruger Mark IV and a Ruger LC9s. Which, I'll point out, 1) I am not in your shoes as a new firearm owner, 2) I do not restrict myself to owning only 2 pistols, and 3) I do not focus much on minimizing my costs, BUT, I regularly carry a Ruger LC9, and do my regular handgunning technique practices with Ruger Mark II and III pistols (the LC9 being the precursor to the LC9s and the Mark II and III obviously precursors to the current Mark IV), so this is a rare instance where my advice isn't "do as I say, not as I do," because it actually IS what I do. I carry a lot of other pistols and revolvers throughout a year, and I do keep a full sized pistol on my nightstand (SigSauer Maxim 9 integrally suppressed full size pistol), but I do carry an LC9 with confidence, and practice with a target style 22LR Ruger Mark II or III.