How do I get out of a minecart?
I did a quick search, and found that somebody had asked the same question on Reddit not 10 hours ago.
There have been three solutions offered, though I can not personally confirm if they work.
The 'R' Key is the suggested key binding to exit the cart. If this is, in fact, the default key binding, any custom key mapping could make this unreliable. That said, it is the only suggestion that has up votes, and others have said the same, so I would expect this to be reliable.
Grappling Hook is a method one user suggests. I assume they ran in to the same issue, and resolved that using the grappling hook was a more efficient way of getting out then looking up the correct function.
"Cancelling the Buff" seems like the most reliable way, in that it does not require a particular item, or presume any default key mapping. Simply look to the top-left of the screen, where you should see a list of your active buffs and de-buffs. One of the active buffs is the mine cart. Right-click on it to cancel the buff, and exit the mine cart.
The minecart acts as a limited mount, so you can get out of it the same way you would dismount (I believe the default is R). If you have a grappling hook, the act of grappling will also cause you to exit the cart.