The best way to determine whether or not you have sodium and/or potassium ions in a solution is to perform a flame test.
A wire loop, usually made out of nickel-chromium or platinum, is dipped into the solution you want to analyze and then held at the edge of a Bunsen burner flame.
Depending on what your solution consists of, the color of the flame will change.
The picture shows the flame colors for the following ions (from left to right): copper, lithium, strontium, sodium, copper, and potassium.
Now, here comes the tricky part. Sodium's yellow emission is much brighter than the emission of potassium, which is why potassium is said to be masked by sodium in solution.
In order to get around this problem, you must use a cobalt blue glass to filter out the yellow emission of sodium. When viewed through blue glass, potassium will color the flame purple-red.
So, if your solution colors the flame yellow when seen with the naked eye, and purple-red whenseen through blue glass, then both sodium and potassium ions are present.
Here's a link to a more detailed examination of the emission spectra for various elements:
A video of the flame test:
It is useful to know that the flame test has some important limitations, like the fact that low concentrations of ions cannot be detected. Another important drawback is the fact that impurities will affect your results.
Moreover, the test cannot distinguish between a number of elements that produce the same flame color, or produce no color at all.