It all depends, of course, on whether we come for a moment (tourism), longer (professionally, scientifically) or for a living... and on what budget we have. Then we can choose the rest.
For a tourist trip, we have a choice of hotels, hostels, guesthouses, private rooms or apartments for rent. You can search for them on sites such as booking, Airbnb or Vrbo. People interested in agritourism have a page: Escapada rural, unfortunately only in Portuguese, but the prices and the place itself can be seen.
Students, apart from assistance from offices at their universities, can use private advertisements on the websites: Custojusto, Idealista, Olx. The downside is that you often need knowledge of the Portuguese language. The price of rooms/flats obviously depends on the place, the bigger the city and popularity, the more expensive it is.
For those who stay longer than the above-mentioned offer, there is still a huge number of larger and smaller real estate agencies and offices dealing with the transfer from country to country.