Hi,
Selling/buying resources is part of economy especially when you take it into account that you gain resources from colonies that never run out :P
Menace forces are purposefully designed to be difficult to defeat especially whit tier 1 weaponry.
Pirates are the weakest with some upgrades and and few tier two rockets but generally have the same stats as your ships.
Sectoids have no shield just heavy armor and good regeneration, but what makes them op is they disruptor weaponry that depletes your weapons capacitators.
My strategy against them is autocannons with armor piercing upgrade, missiles, rockets and torpedoes.
Obviously you need more ships that they have, but a lone sectoid fleet can be beaten by two with enough cannons, dont waste your power on energy based weapons against Sectoids, those take too long to charge and you just gone lose your charge amount when a disruptor hits.
Turn off energy weapons and focus fire with ballistics, missiles and torpedoes
Regarding, machine ai! You need all you can get, they are all around OP, they have excellent defensive capabilities that you have to be able to power through with serious fire power. Machine ai meant to be fought with overwhelming strength and a bucket of luck!
One think to keep in mind that beside pirate raiders, sectoids and machine ai is not actively seeking you out, they have no directive to defeat you unless you happened to be in their way and even then after a fight they usually fly away! For example if you happened to colonize a system that is their destination they arrive and then leave.
You need salvage sensor equipped for your mining mothership in order to be able to salvage technology. You find it in a slot at the front left side of the mining mothership when facing you. Equip that sensor and then for every ships that it salvages it has 15% chance that a technology is salvaged from it, but keep in mind that only those techs can be salvaged that are equipped on the wreck. Also the salvage is only partial so you may need to spend money to complete it.
FYI: When you destroy 3 ships in a battle 3 ships will be salvaged 1 per turn per mining mothership in orbit. The process is automatic just send it to the wreck and you will get report every turn.