What I have on my Specialized e-bikes is a design called "self-extracting crankarm". The crankarm is expected to be installed on the mid-motor spindle.
Please ignore the outer ring: it is what a normal user never even touches. There is an 8 mm hex socket in the centre of the crankarm nut. To remove, you insert the end of a 8 mm 4" long hex wrench into the socket and start rotating anti-clockwise (as for a regular bolt). After several turns, the crankarm is totally extracted from the motor spindle! To do the opposite action: Put the thread of the crankarm onto the motor spindle and start rotating the hex key clockwise. The work is a little bit hard as pulling the crankarm onto the spindle requires some force. Now, eventually you should use an automotive torque wrench and tighten to 50 Nm. However, it is enough to pull the end of the 4" hex wrench with the full hand force, and you will notice it is not possible to rotate the nut any more!
I'm fortunate to only own e-bikes with "self-extracting crankarms", which is in my opinion the most advanced technology in the market. I have forgotten how that was done on older bikes!