Building a room in an underground home is as easy as digging out a space. You decide how big you want the room to be, and you dig out those blocks. Now, it’s tempting to make the room’s size completely arbitrary, but there are several things that are important to keep in mind.
First of all, if your room is too big, you could be using up space that you will find yourself wanting for smaller rooms, branching off from other parts of your home. If you’re completely unconcerned about separating parts of your home, you can go ahead and make your entire underground home one big room- but this isn’t usually the best idea. With flooding being a potential danger to any underground home, using a single huge room leaves your home exceptionally susceptible to spreading water or lava. Also, this makes organization a bit harder to manage.
Probably the biggest reason to have separate rooms inside of any home you create is organization and an underground home is no exception to this rule. This means that it behooves you to dig out multiple rooms within your home. You could make each room a random size, just digging out spaces and connecting hallways however you feel like at any given moment (or just putting a room in each place where there was an ore deposit before you arrived), but it’s generally most helpful to decide what each room is going to be for before you dig it, and then dig out a space based on that use. Certain rooms (storage and library, for instance) will simply need to be larger than other rooms, by virtue of what needs to be fit into them. They may also need to be shaped a particular way, either for the sake of appearance or because of their function.
It can be a bit difficult to work out a decently compact layout, but keep in mind that with an underground base, building up or down is as simple as digging in that direction- no need to worry about building a staircase and walls into thin air- there’s already something there to anchor your structure into. In underground building, it’s especially important to think in three dimensions at all times.
You also want to take lighting into consideration. Underground buildings generally can’t have windows and are a bit harder to keep properly lit than an aboveground structure, which was probably designed with light placement as an easy priority. You want to make sure you have enough spots for light sources, and those spots need to be placed where they’ll keep every bit of your building lit; otherwise, monsters can spawn in your home at -any- time of day.
Finally, if you’re digging underground, chances are you’re going to want to put in a layer of cobble or some other material around each room. While flat gray stone is a useful colored surface aboveground for creating pretty patterns on the outside of your buildings, having the inside of your home in that kind of a tone is frankly boring, and can be very visually offputting. This means, though, that you’ll need to dig out a space one block larger on each side than the room you want to have. Whether you do this by digging out the room and then digging and replacing individual walls, or by digging the room too large to begin with and then putting up a layer of more pleasing blocks all around the room at once, be ready to lay a lot of blocks for the sake of making your home visually un-boring.