On this page of our Diablo Immortal guide, you can view the ways and means of opening a Town portal. Thanks to this page, you'll learn the cost, the destination, and from which locations you can teleport.
Same as with other installments of Diablo, you can use a portal to travel between locations or to escape from one. However, you don't need an item to do so - the only requirement are discovered Waypoints. For your convenience, the locations of them are marked on your map - you simply need to approach them to activate one. The town portal leads to Westmarch, which is a safe zone and a meeting point for players, where you can take up acitivites or improve your equipment.
From there, you only need to open up the world map and select any Waypoint to journey to it. You can travel from virtually anywhere on the map to any discovered point, as long as you are not participating in a closed event (story dungeons or activities with other players). It takes a few seconds to prepare the portal, which means that any enemies will hinder your attempts to create one.
The second option to open the portal is through the inventory window. Here you will find a small portal icon in any bar, which allows you to move to Westmarch or to the nearest safe shelter without looking for it on the map. So it's a pretty quick solution.
However, that's not all - after using the inventory portal, it will stay where you created it. Thanks to this, you can quickly return to the same place from which you moved, especially if you came only to scrap your equipment.