M40 is a double star in Ursa Major – easy to find but not that interesting. Not clear why it got included in Messier’s catalog. The green circle outlines HD238107 and Hd238108 both around magnitude 10. Toward the bottom left is Megrez(mag 3) in Ursa Major where the handle of the big dipper meets the bowl. Between there and M40 is UMa 70(mag 6). Off to the top left is the track of starlink-2657.
This is a quick and dirty capture – 8 images at 90 seconds 800 ISO through the william optics z61(360mm f/6). Processed in Siril with colour calibration, auto histogram, and asinh.