If you can obtain sodium nitrate all you need to do is heat it. (You will have to heat it pretty hard. Research the details.) It will give off oxygen and you will be left with sodium nitrite.
My guess - and it's only a guess - is that potassium nitrite would kill you just as effectively as SN, and by the same mechanism. You can obtain potassium nitrite by heating potassium nitrate. I remember doing that as a kid, at home, to generate oxygen, using a bunsen burner hooked up to the gas cooker in the kitchen. (I had no use for the potassium nitrite.)