We have precedent for this...
In Lincoln's First Inaugural Address, he tackles this from a federal perspective:
Again: If the United States be not a government proper, but an association of States in the nature of contract merely, can it, as a contract, be peaceably unmade by less than all the parties who made it? One party to a contract may violate it—break it, so to speak—but does it not require all to lawfully rescind it?
Descending from these general principles, we find the proposition that in legal contemplation the Union is perpetual confirmed by the history of the Union itself. The Union is much older than the Constitution. It was formed, in fact, by the Articles of Association in 1774. It was matured and continued by the Declaration of Independence in 1776. It was further matured, and the faith of all the then thirteen States expressly plighted and engaged that it should be perpetual, by the Articles of Confederation in 1778. And finally, in 1787, one of the declared objects for ordaining and establishing the Constitution was "to form a more perfect Union."
But if destruction of the Union by one or by a part only of the States be lawfully possible, the Union is less perfect than before the Constitution, having lost the vital element of perpetuity.
It follows from these views that no State upon its own mere motion can lawfully get out of the Union; that resolves and ordinances to that effect are legally void, and that acts of violence within any State or States against the authority of the United States are insurrectionary or revolutionary, according to circumstances.
That was Lincoln's rationale, one which now is eminently embraced by all levels of government within the United States following the Union victory in the Civil War.
Ultimately, if a state tried to secede... i.e. a state legislature and governor ratified an act of secession from the United States, it would be viewed as an act of insurrection against the United States and approached as such. The legal debate over the Constitution as a contract was largely resolved by the outcome of the Civil War.
It looks like /u/rex_derpington answered your question from a historical context. However if your question was how would a state peaceably leave the Union. it might be a question better left to /r/ask_politics.
Though to take a stab at it. It would be very difficult. The US government would be very hostile to the idea of any state leaving the union. That said it might still be possible. It would probably require an amendment to the Constitution and/or a similar process to an amendment in which two-thirds of both houses of congress and three-fourths of state legislatures accept a motion of secession from the union.