Most of the time, when I am working in PostgreSQL I am either in DBeaver or Datagrip. Both of these tools are useful GUIs for interacting with many different database products. Here is an example from Datagrip, where we are looking at a simple function definition.
However, I occasionally find myself inside a PSQL prompt, without access to my usual GUIs. PostgreSQL has several commands that will display database object definitions directly, to the PSQL prompt. In this example, we can easily view function definitions from within PSQL.
The command pg_get_functiondef will display the function definition using only the function name.
The pg_get_functiondef command is a great addition to your PostgreSQL toolbox.