You have two choices OP when you book your flights:
a) Book A to B, and the airline will give options with varying lengths of wait between connecting flights at C. In most such cases your luggage will be checked through, so if you want to leave the airport you will probably need to bring anything for that in hand baggage.
b) Book a multi city option, where you specify A to C, C to B etc. you can input the date for the second flight which means you can stay over for X days on route at the connection city. This is good if you want a couple of days to explore, rather than a few hours.
Under both options you should check visa requirements of the place you are stopping over at. Some might allow you through immigration and out of the airport for a short period without a visa, others will not.
Generally I like to allow at least 3h between connecting flights to allow for airport transit and a bit for flight delays. If you book everything on one ticket and miss your connection, the airline should rebook you on the next flight. I don’t generally recommend booking each leg of the flight separately as the airline then has no responsibility for your onward travel if the first flight is late and you miss your connection.
I’m a very frequent flier and I’ve done a lot of flight connections, so feel free to ask me any questions.