Welcome to the forum.
There is no way to get a guaranteed result. Here are a few points to help you.
- the best option would be to get a documentation of the services and characteristics from the manufacturer of the HM-10 (that would also confirm they want you to be able to use your own device)
- you can use a generic BLE app and scan the GATT profile aka get the services and characteristics UUID and data sizes, reading and writing to the characteristics should help you figure out how the device works
- then you would write the code for a central device assuming the GATT profile does not have any hidden behavior
Now here is the issue, devices like the HM-10 are designed to work together with other HM-10 devices or smartphones. The manufacturer has no interest to have them work together with your ESP32 or even worse with a fake HM-10. So, they may make the device misbehave (disconnect) when they detect a non-original BLE central.
So, you may need to use a second HM-10, or use another Arduino with BLE support instead of the Arduino Uno with the HM-10.