The easiest way is to inverse transform your points by the landscape’s local-to-world so you are working in the landscape’s local space. Landscape-space is set up so each integer coordinate is a landscape vertex, which makes it lovely to work with. You can then transform back into world space to do your raycasts.
Alternatively, (if you’re in the editor) there are various classes for reading the landscape data directly, but these don’t function at runtime.