How to reject incoming calls?

There are a few topics but they are so old and there have been many new components, extensions and others so i have to create a new one

so how can i reject incoming calls or is there any advice to detect incoming calls?also im a beginner