How to fix that: 'Attempting to close HtmlElement 'body' before HtmlElement 'head' was closed'

When I insert a Google tag, an error message appears: ‘Attempting to close HtmlElement ‘body’ before HtmlElement ‘head’ was closed’, how can I fix it?