OnCollisionEnter Error

When I try to use OnCollisionEnter it becomes an error and tells me “Feature ‘local functions’ is not available in C#4. Please use language version 7 or greater.” “The variable ‘OnCollisionEnter’ is declared but never used.” Please help

I have this exact same problem and I NEED help, someone please answer this query as soon as possible