paradisePhysicist said:
tried to make a homemade solenoid and it sucks. The copper has tight little humps in it and it wants to spring out of the compressed coil configuration instead of staying compressed onto the iron.
Start with the wire that is designed for exactly this application. It's called magnet wire. Two sources (not the only sources) are McMaster-Carr
https://www.mcmaster.com/magnet-wire and Allied Electronics
https://www.alliedelec.com/wire/magnet-wire/. Lamp cord has very thick insulation, so you can only get a few turns.
Then you need to, as mentioned above, wind the coil by turning the iron core while the wire unwinds from the spool. The unwind spool turns, the wire does not curl off the end. You can do this with a coil winder or by rigging a hand crank. A hand crank will get the job done. When I was in high school, I made a 10,000 turn coil using a hand crank, and counting turns. It was tedious.
Normal practice is to start at one end, wind a single layer all the way to the other end with each turn tight against the previous turn, then wind another single layer on top of the first layer to the other end, then repeat until finished. If you can wind 5 or 10 layers and still have it laying flat, you are doing very well.
You need enough back tension on the wire to pull it down onto the iron core. If using a hand crank, you can hold the wire with one hand while using the other to turn the crank. Use just enough back tension to pull the wire down snugly onto the iron core. Too little back tension will cause the wire to flop around loosely, too much back tension will damage the insulation and cause short circuits.
When you stop winding, the wire will try to spin itself loose. Wrap it with tape to hold it in place. You need to hold the wire tight with one hand, keep the iron core from spinning backward with another hand, and wrap tape around the finished solenoid with your third hand. Either find a way to lock the core from turning, or ask somebody to help.
If you tell us what you want this solenoid to do, and tell us what you have available for power, we can help you figure out what size wire to use and how many turns will be needed.