Generally, states are sovereign and cannot be sued in federal court without their consent. There are several exceptions to this rule, however.
The Supreme Court may hear a case against a state appealed from the state court system.
Federal courts can hear cases against a state brought by the federal government or by another state.
Federal courts can hear cases against a state where the relief requested is prospective (such as an injunction), rather than retrospective (such as damages), and where the relief ostensibly runs against a state official rather than the state itself.
Congress can abrogate a state’s sovereign immunity when legislating pursuant to its power to enforce the Fourteenth Amendment.