What would need to happen for a state such as California or Texas to split off and form its own independent nation? Who would need to agree and what would need passing (bills etc.)?
There is no official mechanism for doing so. As there is no mechanism, President Abraham Lincoln justified his actions in attacking the Confederacy because they were still a part of a single country.
There are occasionally claims that Texas can secede, because it was an independent state before joining the United States, but as this article states, there is no such provision. But in general, there isn't a consensus on the issue.
The question of secession was resolved as a practical matter by the American Civil War, and as a matter of law by the Supreme Court decision Texas v. White, in which it was ruled that states cannot unilaterally secede from the Union and did not do so during the Civil War.
The court did leave open the possibility of secession "through consent of the States", which presumably means it would have to be approved by Congress. This is extremely unlikely to ever happen.
PearsonArtPhoto is wrong. All States can secede from the United States. You have to understand that the we Americans use the word "State" incorrectly. Just look into the name: "United States of America.
The name is based off of the 13 colonies coming together under a unified flag. A State in it's proper context is a nation. Germany, France, China, etc are all States. To get a better understanding of what the United States really is, look at the European Union and how they decided to make one currency. The European Union is just a hybrid in structure of the United States. They fall under one flag, but are broken up into individual countries. This is the same as the US. The US is nothing more than a collection of smaller sovereign governments. That is why each has their own State Constitution and also why laws in one State can contradict laws in another State, State budgets, etc just like any other country under the European Union. One countries laws are always the same as the next.
So to answer your question, there are already 50 different countries. But to secede, the people of that State have a very short window to get the proper signatures collected to present to the President. But as we have seen after Obama's second election, Texas did get the proper amount of signatures compiled and sent to the President, but the President ignored it anyway.
So yes, a State can secede, but the real question is "Will the President adhere to it?"
The biggest hurdle / problem is that citizens don't recognize that whatever State they live in, it's really a country of it's own. When the people realize their State of residence is really just a country with it's own flag under a bigger umbrella, then they will have the numbers (and power by means of force) to secede whether peacefully or violently.