the easiest way is to do a flame test. Please refer to the wikipedia link given below. However, this test can give a false indication if both species NaOH and KOH are present in the sample, as the flame colour of Na-salts is much more intense than that of K-salts so that the colouration of K-salts wil be "hidden". Na will give a yellow colouration of the flame, K will produce a purple flame colour.
the easiest way is to do a flame test. Please refer to the wikipedia link given below. However, this test can give a false indication if both species NaOH and KOH are present in the sample, as the flame colour of Na-salts is much more intense than that of K-salts so that the colouration of K-salts wil be "hidden". Na will give a yellow colouration of the flame, K will produce a purple flame colour.
You can differentiate them using reactions for detecting sodium and potassium ions in water solutions (of course if the salt i soluble in water). e.g
For Na ions:
1. add KOH and boil the solution, in order to remove NH4+, Mg2+ and Ca2+ ions
2 add HCl until the pH equals 7
3 add K[Sb(OH)6]
4 if sodium ions are present in a cold solution you will get a white precipitate
alternatively you can use Mg(UO2)3(CH3COOH)8 in presence of CH3COOH to get an yellow precipitate
For K ions:
1. add CH3COOH so the sample is weakly acidic
2. add Na3[Co(NO2)6]
3. add AgNO3 (you need to know that halogen anions are absent, otherwise you'll get an false positive when adding Ag to the sample)
4. shake or stir the tube
5. if potassium ions are present in the sample you'll get an yellow precipitate.
The book from which are these methods is in polish so it probably won't be helpful for you: Szczęsny, Rosołowski "Analiza jakościowa" ISBN 83-02-05056-3
An optical filter can be used to block the sodium D-lines in the flame test. I seem to recall from 70 years ago that we used dark blue cobalt glass for this purpose. Any modern equivalent would do. Sodium is always present as an impurity in any potassium salt and even in trace amounts it can confuse the flame test.
Thank you Dr. Holloway for your comment. The suggestion to block certain irritating spectral lines is also montioned in one of the links I provided to Hakeem.