To open a town portal in Diablo 2 Resurrected, you must own a Scroll of Town Portal. It is a scroll that drops randomly from enemies. It drops quite often, and you can also buy it, so you should not worry about wasting it. However, it can take out some space in your limited inventory.
To use the Scroll of Town Portal, simply use the scroll by clicking on it in your inventory, and it will open a portal that takes you back to your camp.
One way to help that is to buy Tome of Town Portal. You can purchase it from Akara in the Rogue Encampment during Act I. She is the person who gives you your first quest, and you encounter her after starting a new save in Diablo 2 Resurrected.
There is also a chance to obtain this Tome of Town Portal as a random drop from a chance but a much safer bet is to just buy it from her.
Tome of the Town Portal can hold up to 20 Scrolls of Town Portal that allow you to get back to your base, sell items, repair gear, enter your base chest, etc.
For more articles on Diablo 2 Resurrected make sure to check out How to find the Horadric Cube in Diablo 2: Resurrected