Technically, solenoids and electromagnets are not the same things, but people speak about them as if they are. A solenoid is simply a coil of wire that becomes an electromagnet when a current is passed through it. Since this is by far the most useful use of a coil of wire, it's no surprise that when you say "solenoid," most people think "electromagnet." Electromagnets are particularly useful because, unlike normal magnets, they can be turned on and off, and their power can be increased by increasing the current flowing through them.
study.com/academy/lesson/what-is-solenoid-definition-uses-examples.html