There are a lot of things that can go wrong with your computer if you don't take care of it through maintenance and check-ups, but even if you do. Even if you do, there's still a chance it could break due to other factors. If you're PC starts smoking. Here's what you should do.
1. Unplug It Immediately
If the smoke is small enough and you believe that it will not cause extensive damage, you can shut down the PC first before unplugging it, but it's best not to risk it and just unplug the device as early as you can. Removing it from the power source prevents further damage, and it will cut off power from whatever is causing it to smoke.
2. Extinguish Any Fires
If there is a fire you have a closed PC, carefully open it but not before making sure that the PC case is not too hot. Use a fire extinguisher specifically for electrical fires. Never use water as it will cause further damage to your PC. If you don't have the proper fire extinguisher for the emergency, you can suffocate the fire with cloth but be careful not to set it on fire as well.
3. Open Up the Space
Don't let the smoke fill up the room. Open up your door or windows so that the smoke and fumes can be evacuated. Proper ventilation after the incident will prevent you from inhaling any harmful smoke. Don't close your windows right away. Leave it open for hours or at least until the smell of the burning components is gone.
4. Asses the Damage or What Caused It
If you believe that it's safe enough, you can assess the damage that it caused and see what components were affected by the fire. If you have expertise with computers, you may even assess further to determine how you may be able to fix it. If not, it's better to leave it to professionals since you might cause more damage.
5. Contact a Repair Service
Having a professional take a look at your PC may be pricey, but they will know to determine what kind of damage needs fixing. It won't just be the burnt components but potential smoke damage as well. They will know the steps to take to make sure that your device won't take any more damage, or maybe even determine what caused the fire so you can prevent it next time.
6. Look for Ways to Back Up Your Data
Professional repair shops may be able to save your data if you bring your computer in, although that will depend entirely on the kind of damage your PC has sustained. This might be important if they can't fix your PC anymore.
If you believe that the PC cannot be fixed, one way you might be able to recover your data is by taking out your PC's hard drive. Disconnect the cables and take it out, and you can place it in a hard drive enclosure.