Suicide laws don't prevent people from killing themselves. Suicide laws exist partly to codify established social norms.
From what I read, suicide (or attempting suicide) hasn't been illegal in canada for quite a while:
"The common law crimes of attempting suicide and of assisting suicide were codified in Canada when Parliament enacted the Criminal Code in 1892.[7] Eighty years later, in 1972, Parliament repealed the offence of attempting suicide from the Criminal Code based on the argument that a legal deterrent was unnecessary."
https://en.wikipedia.org/wiki/Suicide_legislation#Canada