A useful approach is to utilise the 'two-thirds rule'; opting for a sofa width that is no more than two-thirds the width of the wall behind it. If you have enough space for a sofa that's half the width of the wall behind, this will increase the feeling of spaciousness further. It also allows for end tables or floor lamps at either end.
As well as the width and depth, take into account the sofa's height, especially if it needs to fit under any existing architectural details like a windowsill or picture rail. Marking out the dimensions with tape is a useful way to get a sense of scale.
Consider access dimensions, too. A narrow entranceway, awkwardly shaped hallway, or staircase will need to be measured to ensure the sofa will fit through doorways and tricky access points. Check whether your chosen sofa has removable legs or needs self-assembly if space is tight.