counting after button pressed and released

i am new here and i work on a project that if button pressed and stay pressed for more 3 sec turn on led
else stay off and if button relaesed for more 3 sec and the led was on turn it off or still on
thnx for any advice

i work on a project

That means that you have some code that you didn't post.

The state change detection example shows how to determine that a switch has become pressed (so you can record when that happens, using millis()) or has become released (so you can record when that happens, and use the two times to determine how long the switch was pressed).

its still idea and i dont know where to start but tnx any way and i will try it