Prior to its formal decommissioning, the ship in question will begin the process of decommissioning by going through a preliminary step called inactivation or deactivation. During this phase, a ship will report to a naval facility owned by the country in question so as to permit the ship's crew to offload, remove, and dismantle the ship's weapons, ammunition, electronics, and other material that is judged to be of further use to the nation in question. The removed material from a ship usually ends up either rotating to another ship in the class with similar weapons and/or capabilities, or in storage pending a decision on equipment's fate. During this time a ship's crew may be thinned out via transfers and reassignments as the ongoing removal of equipment renders certain personnel (such as missile technicians or gun crews) unable to perform their duties on the ship in question. Certain aspects of a ship's deactivation – such as the removal or deactivation of a ship's nuclear weapons capabilities – may be governed by international treaties observed by the country in question, which can result in the presence of foreign officials authorized to inspect the weapon or weapon system in question to ensure compliance with a given treaty. Other aspects of a ship's decommissioning, such as the reprocessing of nuclear fuel from a ship utilizing a nuclear reactor or the removal of hazardous materials from a ship, are handled by the government in question according to the nation's domestic policies on such matters. When a ship finishes its inactivation, it is then formally decommissioned, after which the ship is usually towed to a storage facility.
In addition to the economic advantages of retiring a ship that has grown maintenance intensive or obsolete, the decommissioning frees up the name used by the ship, allowing vessels currently in the planning or building stages to inherit the name of the warship in question. Often, but not always, ships that are decommissioned end up spending the next few years in a reserve fleet before their ultimate fate is decided.
Information Courtesy of Wikipedia