I added action wpcf7_before_send_mail but not effect anything, Even I put to exit function its also not working. Then I removed all function.php file that not affect the website. Please tell me how and where to add a custom function.
If you want to add JS code, you need to add it in the Theme Settings > Custom JS.
If you want to add PHP code, you need to upload, install and activate the child theme (you can get it from the Theme folder on the Themefores) and add all the code to functions.php file.