Assuming you’re using enhanced input, you use the ‘started’ pin to detect when the button is pressed, and ‘completed’ or ‘canceled’ pins for detecting a release, depending on circumstances.
It can get a bit complicated at times but that’s the standard way of doing it.
Here you can see the pins i’m talking about
You can control the required time for the button to be held to start doing whatever it is you want to do in the input action or input mapping settings. But like I said it can get a bit complicated, experiment with it.