If it were me I would try to buy components first, whether factory ammo or reloading stuff, then buy a rifle. If you are in the fence about two cartridges, see which one you can get ammo for first.
Going in reverse order could work, too, but you may have a gun and no ammo for 3 weeks or no ammo for a year, just hard to know.