If the constitutionality of this issue would be tested by SCOTUS is it
required that some sort of litigation must precede it?
Yes.
Unless there is an actual case or controversy within the original jurisdiction of SCOTUS (mostly lawsuits between U.S. states over boundaries and water rights), every case the comes before SCOTUS has previously been ruled upon by a trial court and either one of the U.S. Courts of Appeals, the U.S. Court of Military Appeals, a territorial supreme court, or the highest court of a U.S. state (a handful of cases, mostly involving election law, are decided by three judge panels at the trial court level that rule on constitutional questions, and appealed directly to the U.S. Supreme Court from there).
In cases raising a constitutional issue, therefore usually have two previous rulings (or often three in appeals from state courts with their own intermediate appellate courts) on the constitutionality issue originally raised in the trial court (or administrative proceeding that concludes with an appeal directly to an appellate court).
Critically, the U.S. Supreme Court is not the only court in the U.S. that can determine that a statute or practice is unconstitutional.
Basically every court in the United States from traffic court to state and federal trial courts to intermediate appellate courts and state supreme courts to the U.S. Supreme Court has the right and the obligation to declare a right or practice that is clearly unconstitutional that comes before it to be unconstitutional if a party to the litigation raises the issue in a timely manner.
The U.S. Supreme Court may decline to revisit the decision on the constitutionality of a law made by a lower court, and in that situation, the lower appellate court (or in rare cases such as some election law cases, lower trial court) ruling stands, but has precedential effect only in the territory subject to that lower appellate court's jurisdiction.
This allows other lower appellate courts with a different territorial jurisdiction to consider the constitutional issue afresh in its jurisdiction and possibly reach a conflicting result.
Often, the U.S. Supreme Court will resolve a split of authority on the constitutionality of a law between lower appellate courts with different jurisdictions, but it often doesn't do so right away, allowing a variety of perspectives on the issue to develop in the courts before it established a uniform national rule on whether a law or practice is constitutional.
Do you first need some sort of government agency that wants to do it,
someone who objects and then for this issue to go to court or can a
civil rights group ask for a judgment before it is actually enacted?
Can courts make judgments like this or do they not handle
hypotheticals or judge the constitutionality of things that might one
day occur?
There is a requirement in federal courts including the U.S. Supreme Court that there be an actual "case or controversy" and that the party bringing the suit has "standing" which means an injury in fact to a legally protected interest that is distinct and particularized from the injury to other citizens or taxpayers.
When a civil rights organization brings a lawsuit, it needs to either itself be directly affected as an organization or to have a member of the organization or test plaintiff represented by the organization bring suit to invalidate the law.
A constitutional issue can also be raised by a defendant as a defense to a lawsuit or criminal prosecution seeking to enforce an unconstitutional law.
A federal court can not rule in a merely hypothetical case.
But some state supreme courts are granted that authority, for example, following a petition from the Governor or the state legislature, under a state constitution, typically to apply the state constitution, although federal constitutional issues may be intertwined with state constitutional issues.
Sometimes, the "chilling effect" of being subject to an unconstitutional criminal law is sufficient to have a court issue a preliminary injunction preventing the law from being implemented until the court system determines the constitutionality of the law without actually being charged with a crime, if the individual would be likely to be prosecuted for the crime if it was in force.
Similarly, a public official could, for example, bring a declaratory judgment action in the appropriate trial court, stating that the public official is forced to take some action and doesn't know whether the public official should take the action required by a possibly unconstitutional law, or the action that the public official would take if the law were constitutional, and asks the court what to do. This is still an actual case or controversy because some action must be taken that hinged upon the validity of the law.
Most states rules of procedure and federal procedural law in most cases, requires that the attorney general be given notice of a claim that a statute is unconstitutional and an opportunity to intervene in the case with respect to the constitutionality issue if it is raised.
If the attorney general given notice agrees that the statute is unconstitutional, the court will typically appoint someone else to serve as an attorney arguing as a devil's advocate for the validity of the law in addition to the attorney general in the case, to inform the judge's decision, if it is a novel issue not governed by clear prior precedents.