The lens is obviously one of the most fundamental pieces of photography gear along with the camera, but strictly speaking, you do not actually need one to create an image. This interesting video will take you behind the scenes of a neat photography process that lets you take photos without even using a lens and show you the workflow and results.
Coming to you from Steve O'Nions, this awesome video will show you the process of pinhole photography and some of the results. Pinhole photography derives from the long-known camera obscura principle. It involves placing film in a light-sealed container and poking a small hole opposite the film's surface. This will project an image onto the film, allowing you to create images with no need for a lens. As you might have already noticed, a pinhole-sized opening results in an extremely narrow aperture, frequently smaller than f/100 or even f/1,000, resulting in extraordinarily long exposure times that can create neat effects. As you will see, you should not expect top-shelf image quality from the process, but it is a simple, fun, affordable, and different way of creating images that can be quite satisfying. Check out the video above for the full rundown from O'Nions.
I find that if I intend to shoot pinhole, I need to leave the house without a digital camera. It's a different way of seeing, and I tend to shoot digital if I'm carrying digital.
But when i do it in Nikon D3500, camera just won't click anything it just shows error no lens
Check the manual whether there is an option of 'shutter release without lens'. It's meant for manual lenses without aperture / focus coupling.