You click on the link that says download, from this page.
How else would you download it? The button is blue, appearing on the upper right part of the page. That you are asking seems to say there is a problem. I just tried it. When I do, I find a file named kstest_2s_2d.m.
Does that link not work for you? Or is the problem you do not know what to do with the function, thus how do you make MATLAB see the file? In that case, you may need to learn about your search path in MATLAB. The functions addpath, savepath, pathtool may be of use to you.