I don't know how many constraints you have; for example must this be EXACTLY 40.00 mL? What kind of equipment do you have; e.g., do you have measuring pipets?
For starters, the easy way, without a bunch of constraints, is as follows:
How many mols (or millimols) NaCl & KCl do you need? That is
40 mL x 0.005M = 0.2 millimol NaCl.
40 mL x 0.025M = 1.0 millimol KCl.
Since M = mols/L = mmol/mL, then
mL = mmol/M.
mL concd NaCl needed = 0.2 mmol/0.6 M = 0.333 mL of the 0.6 M NaCl.
mL concd KCl needed = 1.0 mmol/0.1 M = 10.0 mL of the 0.1 M KCl.
So I would add 0.333 mL of the 0.6 M NaCl solution to a 40 mL volumetric flask, add 10 mL of the 0.1 M KCl solution to the flask, add distilled water to the mark and mix thoroughly.
This may not be an acceptable answer because as far as I know 40 mL volumetric flasks aren't sold. A way around that would be to make the same kind of calculation, use a 50 mL volumetric flask, and throw 10 mL of the final solution down the drain. Another problem is that pipets that measure 0.333 mL are not readily available. That presents a little problem but probably we could work around that. I may be setting up straw men. Let me know if this answer isn't good enough but define any constraints.