GLFW documentation on Mouse Input
Java and Kotlin don’t support pointers, so you need to create a buffer to read the mouse position (StackOverflow post)
Mouse Picking with Ray Casting
Article by Anton Gerdelan on Mouse Picking with Ray Casting.
Tutorial on Model-View-Projection matrices in OpenGL
As a reference, code I wrote many years ago in C++:
JOML has unprojectRay
(documentation)
Camera movement
opengl-tutorial on Keyboard and Mouse