This is hard, but perhaps even harder than you might think. I read an extremely long exploration of this concept a couple weeks ago. It's a layman explanation but it really does a great job of outlining the real complications of such a device. Here's the article: https://waitbutwhy.com/2017/04/neuralink.html
One takeaway that gives you the sense of scale: there are at least 40,000 neurons in 1mm^3 of the cerebral cortex. Those 40,000 neurons create around 20,000,000 synapses. You have to create a sensor that can capture a reasonable portion of those synapses to understand what's going on in that tiny section of the cortex.