How to hook code in ?

The action you are looking for is wp_body_open(). I do not know if you are writing your own theme or not but if you are using a pre-built theme, the author of your theme may not have included this support.

If properly supported in your theme, any function hooked to this action will be called immediately after the page opening <body> element.

WordPress reference:
https://developer.wordpress.org/reference/functions/wp_body_open/

Additional theme reference:
https://generatewp.com/wordpress-5-2-action-that-every-theme-should-use/

404 Not Found

Not Found

The requested URL was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.