It is a moth pupa. We can't tell the species, at least not for sure, until it emerges.
It would have been in the soil, or in the grass thatch laying on the soil surface below the growing blades of grass.
To keep it and give it a good chance of emerging, I suggest you get a handful of slightly damp soil or leaf mould or soil-less compost in a container, put the pupa on top, then very carefully move just a few mm of soil over it. Handle the pupa very carefully! Do not try to grasp it between your fingers of with tweezers. Scoop it up onto a piece of paper. And do't be surprised if it wriggles - that's a sign it is alive. Keep the container in a larger, transparent, one and yes, provide a means for air to circulate. It looks fairly well advanced, so it may almost be ready to emerge, but one can't be sure how long it might remain at that stage, awaiting good conditions to trigger its emergence. The tricky thing will be keeping its environment from going stale and mouldy but without letting it get too dry (dryness could make it hard for the insect to break through the pupal skin). Don't keep it too warm - keep it in a garage or shed or an unheated room. Look at it daily, in case it has emerged.
Altenatively, if there is a safe part of the lawn (safe from people, pets, playthings, etc.), you could put if back amongst the grass, and cover it with a fine wire mesh (no more than 2mm) formed into a cage. and kept in place by wires and/or a stone ontop. That will give it the best chance through giving it a natural regime of air and moisture. Make sure it is not exposed to the sun. Still inspect it daily. Once the moth emerges it will be prey to many other creatures.
Keep fingers crossed.
Let us know what happens!
My first impression is Elephant Hawkmoth, Deilephila elpenor - and that's pretty much my last impression too.
See info and images on Tony Pittaway's website: