Recover the Wind Farm Kill Switch Code
This is located on a small islet north of Rayburn Point. After recovering it, the quest “Cleansing the Land” will start. After getting the code, you can either confront DiMA about it or use it to power off the wind turbines powering Far Harbor’s fog condensers.
This can be done by travelling to the Wind Farm Maintenance Shed. The security door inside will require power so search the area for four industrial fuses then plug them to the fuse box. Open the door then head inside. Follow the quest marker to reach Turbine #3. Defeat the security turrets and assaultrons along the way then use the terminal to use the kill switch code and power off the wind turbine. (If Longfellow is with you while doing this, he’ll turn hostile immediately)
Shutting down the wind turbines will turn off Far Harbor’s fog condensers and trigger the invasion of several creatures of the fog to the town. The townspeople will defend their home valiantly but won’t be able to stand against the brutal fog creatures for long. If there are any survivors left, they’ll be permanently hostile towards you, including Old Longfellow. Doing this task will fail the quest "The Way Life Should Be" and start "Close to Home".
Additionally, if you’re a member of the Children of Atom, you can talk to Tektus to receive an Inquisitor of Atom perk, a Bulwark armor, and the title of Inquisitor for eliminating the non-believers.
Locate the Nuclear Launch Code
The code is located in Harbor Grand Hotel. As soon as you enter, the quest “Best Left Forgotten” will be completed and this objective willl be added to the “Cleansing the Land” quest. Enter the main hotel building and go to the second floor. You have to go around the broken wall of the kitchen to get to the room with the marked keypad. Interact with it to open a saferoom. There's a holotape on the floor that you can play. There are two ammo boxes in the room, one is novice-locked. There's an Expert wall safe for you to break as well. Once done looting, interact with the terminal and play the security tape.
Now head to the Fringe Cove Docks and follow the quest marker. The nuclear code is found on a sunken boat near the dock, inside a floor safe on the boat's deck. Be wary though since there’s a lot of anglers and mirelurks in the area. After obtaining the launch key, you'll have new options on how to proceed next. You can use the Launch Key to destroy The Nucleus, confront DiMA about it, or speak to the High Confessor about it.
You can manually launch the nuke payload without informing the high confessor. The terminal is located inside the submarine where the High Confessor resides. This will turn every Children of Atom inside The Nucleus to become hostile, making it more difficult for you to escape the place within 30 seconds before the nuke wipes the place off the map. The quest will be complete after the Nucleus is destroyed but this will fail the quest Reformation at the same time.
If you talked to the High Confessor about the codes, you can convince him via speech checks to launch the nuke. You can only do this after proving your worth to the cult by completing various quests for them. After successfully convincing him, launch the nuke payload using the terminal inside the sub. You can peacefully (and quickly!) leave the area within 30 seconds to avoid getting caught in the explosion. The quest will be complete after The Nucleus is destroyed but this will fail the quest Reformation at the same time. However, you’ll get the Far Harbor Survivalist perk instead.
Unlike the other way around, if you destroyed The Nucleus and talked to the faction leader of the harbormen (Avery) in Far Harbor, you won’t get any sort of reward.