You must have a job offer from an employer in Portugal. The job opening must have been posted for at least one month, so the relevant authorities can ensure that a Portuguese or EU citizen could not have filled the position instead.
Your employer must apply for a Work Permit on your behalf. They submit the application to the Portuguese Labor Authorities.
Do I Need a Visa to Work in Portugal?
If you are not an EU/EEA or Swiss citizen, then you need to apply for a visa to be allowed to work in Portugal. If you are from the EU/EEA or Switzerland, then you can work without a visa, but you have to get a Residence Certificate (Certificado de Registo) if you intend to live in Portugal for longer than three months.