If you are not a Canadian citizen or permanent resident, you need a work permit to work legally in Canada.
In general, you need to apply for a work permit from Immigration, Refugees and Citizenship Canada (IRCC) or a Canadian visa office before you come to Canada. For these work permits:
There are special work permits for some kinds of workers. For example, there are special work permit programs for caregivers, business people and agricultural workers.
There are different types of work permit inside Canada which you can apply depending on your qualifications and certain other conditions.
For more information, go to Working Temporarily in Canada on the IRCC website.