You can apply for EAD at the
same time you file your I-485. Once you get EAD, you can use that to work.
In theory, I-140 and 485 can be filed together for several categories, such as NIW, in which case, you can request EAD at the very beginning of your green card petition.
But it is safer to use EAD ONLY AFTER your I-140 has been approved,because once 485-based EAD is used, you will lose your non-immigrant status, and if your hu*****and's 140 is denied, you will be out of status and have to leave the country.