If you are passing variables from one Test Case to another Test Case within a Test Suite, you can do it with Global Variables or static variables, as discussed in the link below.
If you are passing variables from one Test Case to another Test Case outside of a Test Suite, then you need to Save those variables to a spreadsheet or data file. There are examples of this on this forum, such as: