Welcome to the Wefugees community!
As a very similar question has previously been asked and answered on our platform, please have look :-)
You can find the answer here:
Asylum to Canada While on transit
Also, have a look at this website by the Canadian government about "Claiming Asylum in Canada - what happens?":
Please note that flying to Canada requires a visa (also check the expiry date of your passport):
"Holders of Alien’s passport and Stateless individuals need a visa to visit or transit Canada"
Here is more information on how to get a visitor's visa:
I hope these sources help. Of course you can reach out to the community again if you have any further questions!
All the best,