You have two basic options.
If you want to apply from outside of Canada, you must first ensure you're living outside of your home country. Next, you must be officially recognized as a refugee by UNHCR or a similar referral organization so that you you can apply for resettlement in Canada.
If you want to apply for refugee status from within Canada, then you need to apply for and successfully obtain a TRV (tourist visa). You can then claim asylum once you arrive in Canada.