In VHDL, functions and procedures are declared inside packages to organize reusable code. The package declaration lists the functions and procedures available. Their actual code is written in the package body. Functions return values, while procedures perform actions without returning values. After defining a package, you can use it in your design by calling these functions and procedures. This visual trace showed defining a package with a function 'add' and a procedure 'show_sum', implementing them, and then calling them with values 2 and 3. The function returned 5, and the procedure displayed a message with the sum. Declaring functions and procedures before use is necessary to avoid compilation errors.