How to go to (run) specific function

I created a function called (error)
I need to add a code in void loop in an IF statement condition that if condition is true, the program will go the function (error) and execute its contents.
Is it possible?
Thanks in advance

Arduino functions.

Just be aware that when it returns to loop() from error(), if the "fault" has not cleared in the meanwhile it will run error() again. You may want to flag it so it only runs once, then clear the flag when the error clears, so it will only run again for a new error.

Thanks alot