I don't know what the costs involved in an "average" citizenship case ultimately amount to, but the process does take many years for most, and I'd assume that's another motive for trying to get around it. First you have to acquire Longterm Permanent Resident (LPR) status--i.e., get a Green Card--which in itself usually takes several years. This begins with a qualifying relative or employer petitioning US Citizenship & Immigration Services (USCIS) for your right to apply for a visa (if it's an employer, they must first prove that no current US citizens or LPRs are available to fill the position for which you'd be hired). Once the petition is approved, then you (or your employer) apply to the State Department for an immigration visa. This process takes anywhere from around 6 months (it's faster if it's an employer filing) to several years, depending on the quotas for the country you're coming from and various other factors. Then once you have the visa, you're ready apply to USCIS for permanent residency status, which also requires assembling a large array of documentation--tax records, medical records, employment records, etc. Currently this process averages about 3 years, according to their website. Often during this time the visa expires, so you have to leave the country and then start that process all over again. LPR status does NOT give you the right to bring your spouse or children to the US.
There's also the "Green Card Lottery," which is mostly for prospective immigrants from countries with low rates of immigration to the US, and which if you're selected allows you to bypass much of the above. However, proportionally very few immigrants acquire LPR status this way, as selection is random (relative to the limited country-of-origin pool) and the number of Green Cards available through lottery is very limited.
Once LPR status is obtained, then you must reside continuously in the US as an LPR for 5 years before being eligible to apply for citizenship, which requires basic command of English (except in the case of some longstanding older LPRs), as well as of course passing the citizenship exam.
The only fees I was able to find data on (and these are only averages) is that the immigration visa application fee is about $40 (each time), the LPR status application fee is about $30, and the citizenship application fee is about $50. But presumably there are in practice many other costs involved (travel, legal consultation, assembling the needed documentation, vaccinations, etc.).
Of course there are a zillion and one potential exceptions to any or all of the above involved, but so far as I know this is roughly how a "typical" citizenship acquisition process currently works.