I really recomend using the new input system rather than the default one, check out Samyam https://www.youtube.com/c/samyam she really have everything you need to understand the new input system.
I have trust issues with the basic function call like onmousedrag cause I don't always understand what's going behind the code. Using the new input system you have to make everything yourself (kinda) but at least its a lot more clear