How is a memory location accessed by random access?
Figure 1. An 8-bit wide random access memory. Image source: ETSU.
Steps:

Select the address to be read. This is binary coded and fed into the memory address decoder.
The address decoder selects one row of memory.
That row of memory is connected to the databus and outputs a low (0) or high (1) voltage signal on each line.

The diagram alludes to some additional logic such as read/write (to tell whether to put data out on the address lines or to write the contents of the address lines into that memory row) and &quot;chip select&quot; which would be used when more than one memory chip is used.

I imagine it as a matrix but I can't figure out how it can access exactly to position 1000 without having to go through the other positions. How is this position calculated exactly?

The position isn't calculated. It is selected. In your example of reading address 1000 you will need at least a 10-bit address bus (which gives 210 = 1024 addresses). 100010 = 11111010002 so the address lines would be set to that binary address, the address decoder will immediately select row 1000 and put the data out on the data bus. Any address can be read at the same speed. (High addresses do not take longer to access or read.)


Figure 2. A 3-to-8 decoder enables the output (Y) selected by the binary address code (X0 to X2). The logic is arranged so that only one output is on for any input combination. Image source: Codestall.
Obviously, a 10-bit addressing scheme would require a correspondingly large decoder.