If you are a Canadian you will have to apply to the Canadian Space Agency which works closely with NASA. Over the years Canadian astronauts have flown on the Space Shuttle and have worked on the International Space Station. In fact, Expedition 59 crew, including a Canadian astronaut David Saint-Jacques, is returning to Earth today. Other Canadians who have flown in space are Roberta Lynn Bondar, Marc Garneau, Chris Hadfield, and Steve McLean, just to name a few; but then if you really want to be an astronaut you would know that already.
While the high performance aircraft flying experience was helpful when NASA needed pilots for the Space Shuttle, the scientific work carried out on the ISS, and whatever comes after it, favors more scientific background. You will need to get an advanced degree, PhD preferred, in engineering, (it doesn't necessarily have to be aerospace engineering) medicine and life sciences and be in the top percentile in all your classes.
Read biographies of astronauts from Canada, US, Europe and Japan to see what kind of academic credentials NASA and other space agencies are looking for.