With a game master/dungeon master (GM or DM) who knows the rules and guides a party of players through the adventure.
There are multiple other games in this genre, all with slight differences in the specific rules, e.g. which dice are used for which case (what is the numeric range of various random variables).
The general principe of a RPG applies (i.e., D&D is the grandfather of most RPGs) - you need to create a character of a given race (human, elf, darf, ...) and class (thief, bard, warrior, cleric, wizard,...) who is then equipped with certain strenghts and weaknesses, determined (at the start) through rolling dice. Then you set up a party (usually multiple players, each one playing one character) and, together, move through an adventure. Which can be from a book or, in the case of a more experienced DM, written/created by the DM.
Usually, the setting is a medieval/fantasy environment - but as the DM is in fact the god of your little universe, anything is possible.