Simply redirect a 404 to a custom page

Hi,

-how can we simply add some code to redirect all 404’s to a custom page?

Thanks!