The quick check
Dial *#06# on your phone. If you see a line called EID (a long number), your phone has an eSIM chip.
On iPhone you can also open Settings, General, About and scroll down: an EID line means eSIM support. iPhone XS, XR and every newer model support eSIM.
Android phones
Most Google Pixel phones from the Pixel 3 onward support eSIM, as do Samsung Galaxy S20 and newer, and recent foldables. Budget models and some phones sold in China or Hong Kong do not.
On Android, look in Settings, Network and internet, SIMs. An option to add an eSIM or download a SIM means you're set.
The carrier lock
A phone bought on contract may be locked to its carrier. A locked phone shows the eSIM chip but refuses a travel eSIM from another company. Ask your carrier to unlock it before you travel; in many countries they must do this once the contract is paid off.