Unions don't have the power to prohibit you from having a job per se. They only have the power to negotiate exclusive contracts with employers; just like you could negotiate an exclusive contract with an employer to be their sole [whatever], if you had the leverage to get them to agree to that (like if, say, you were the sole proprietor of a prestigious subcontracting company, and they wanted your services badly enough to give you all their jobs if you demanded it). Employers are free to not employ unions, if they're willing to forego the labor pool in that union and only use non-union labor. Or, you know, they could negotiate with another union instead, just like anyone in the non-union labor pool can join together into another union and try to outcompete the first union for contracts.
The mirror image of this exists on the employer's side too. A local orange grower is free to go it solo and just sell his oranges at the farmer's market or something, and try to compete against big names like Sunkist; or, he could join with Sunkist (which is nothing but a cooperative of individual growers), and sell his oranges through them. Many sellers of commodities work that way, many individual sellers joining together into a unified brand to sell their product together, because that gives them a huge advantage over any one individual seller. (And for each individual seller participating too, it comes with disadvantages similar to those that union workers face, namely just being one interchangeable piece of a larger whole and not being able to fight for any special treatment). The only place where that kind of thing doesn't make sense is when artificial monopolies due to intellectual property make it absurd to even speak of; it's not like someone else could try (however vainly) to compete with Apple in the market for iPhones, so of course anyone who wants to sell iPhones has to join up with Apple to do so. But if that weren't so -- if anyone could just build and sell identical iPhones -- you would still expect to see individual iPhone makers eventually banding together for the competitive advantage, just like commodity sellers do, and just like laborers do in unions.