1

Pick a city of the world to your liking and retrieve its bounding box. Then plot it: What do you see?
The function you may search is part of the osmdata package.
dresden <-
  osmdata::getbb("Dresden")

plot(dresden)

# We see two points, which build the extremes of the bounding box.

2

Please choose one or two building types you are interested in and set them as key and value pairs. You can find a list of building types in the Overpass API documentation. But don’t forget to set the timeout query parameters first using the osmdata::opq() function.
First, you specify the bounding box like before, second, the query parameters, and third, the key and value pairs. Try two use a pipe workflow as it makes it a bit easier.
dresden <-
  osmdata::getbb("Dresden") %>% 
  osmdata::opq(timeout = 25*100) %>% 
  osmdata::add_osm_feature(
    key = "building", 
    value = c("house", "residential")
  )

3

Download the data using the osmadata::osmdata_sf() function and extract only the polygons.
The downloaded data are a list. The polygons are a named list element that you can extract with its name osm_polygons, just like a variable in a data table.
dresden <-
  osmdata::getbb("Dresden") %>% 
  osmdata::opq(timeout = 25*100) %>% 
  osmdata::add_osm_feature(
    key = "building", 
    value = c("house", "residential")
  ) %>% 
  osmdata::osmdata_sf() %>% 
  .$osm_polygons

4

Take some time to browse through the data. Depending on the building type you have chosen, you may find some interesting information. You can also plot the data you have just downloaded.
You may consider converting the data into a tibble using tibble::as_tibble() and maybe a sf::st_as_sf() afterwards for a nicer browsing experience.
library(tmap)

dresden <-
  osmdata::getbb("Dresden") %>% 
  osmdata::opq(timeout = 25*100) %>% 
  osmdata::add_osm_feature(
    key = "building", 
    value = c("house", "residential")
  ) %>% 
  osmdata::osmdata_sf() %>% 
  .$osm_polygons %>% 
  tibble::as_tibble() %>% 
  sf::st_as_sf()

dresden
## Simple feature collection with 13927 features and 114 fields
## geometry type:  POLYGON
## dimension:      XY
## bbox:           xmin: 13.57913 ymin: 50.97482 xmax: 13.96545 ymax: 51.17778
## geographic CRS: WGS 84
## # A tibble: 13,927 x 115
##    osm_id name  X3dr.type abandoned access addr.city addr.country addr.housename
##    <chr>  <chr> <chr>     <chr>     <chr>  <chr>     <chr>        <chr>         
##  1 22986~ <NA>  <NA>      <NA>      <NA>   Dresden   <NA>         <NA>          
##  2 22986~ <NA>  <NA>      <NA>      <NA>   Dresden   DE           <NA>          
##  3 22986~ <NA>  <NA>      <NA>      <NA>   Dresden   DE           <NA>          
##  4 22986~ <NA>  <NA>      <NA>      <NA>   Dresden   DE           <NA>          
##  5 22986~ <NA>  <NA>      <NA>      <NA>   Dresden   DE           <NA>          
##  6 22986~ <NA>  <NA>      <NA>      <NA>   Dresden   DE           <NA>          
##  7 22986~ <NA>  <NA>      <NA>      <NA>   Dresden   DE           <NA>          
##  8 22986~ <NA>  <NA>      <NA>      <NA>   Dresden   DE           <NA>          
##  9 22986~ <NA>  <NA>      <NA>      <NA>   Dresden   DE           <NA>          
## 10 22986~ <NA>  <NA>      <NA>      <NA>   Dresden   <NA>         <NA>          
## # ... with 13,917 more rows, and 107 more variables: addr.housenumber <chr>,
## #   addr.postcode <chr>, addr.street <chr>, addr.suburb <chr>,
## #   addr.suburb.en <chr>, alt_name <chr>, amenity <chr>, animal <chr>,
## #   attraction <chr>, building <chr>, building.architecture <chr>,
## #   building.colour <chr>, building.levelPlan <chr>, building.levels <chr>,
## #   building.levels.underground <chr>, building.material <chr>,
## #   building.part <chr>, building.roof <chr>, building.roof.colour <chr>,
## #   building.roof.shape <chr>, building.use <chr>, castle_type <chr>,
## #   cn_tud.token <chr>, colour <chr>, comment <chr>, construction <chr>,
## #   construction.building <chr>, contact.email <chr>, contact.fax <chr>,
## #   contact.mobile <chr>, contact.phone <chr>, contact.website <chr>,
## #   created_by <chr>, description <chr>, description.de <chr>, disused <chr>,
## #   dormitory <chr>, ele <chr>, email <chr>, emergency <chr>,
## #   emergency_service <chr>, entrance <chr>, fax <chr>, fixme <chr>,
## #   healthcare <chr>, height <chr>, heritage <chr>, heritage.operator <chr>,
## #   historic <chr>, image <chr>, internet_access <chr>, last_check <chr>,
## #   layer <chr>, loc_name <chr>, loc_ref <chr>, location <chr>, man_made <chr>,
## #   microbrewery <chr>, min_height <chr>, name.en <chr>, noaddress <chr>,
## #   nohousenumber <chr>, note <chr>, number_of_apartments <chr>, office <chr>,
## #   old_name <chr>, opening_hours <chr>, operator <chr>, outdoor_area <chr>,
## #   phone <chr>, photo <chr>, railway <chr>, railway.ref <chr>,
## #   railway.signal_box <chr>, roof.angle <chr>, roof.colour <chr>,
## #   roof.height <chr>, roof.levels <chr>, roof.material <chr>,
## #   roof.orientation <chr>, roof.ridge <chr>, roof.shape <chr>,
## #   school_type <chr>, seamark.landmark.category <chr>,
## #   seamark.landmark.conspicuity <chr>, seamark.type <chr>, shop <chr>,
## #   smoking <chr>, social_facility <chr>, social_facility.for <chr>,
## #   source <chr>, source.addr.housenumber <chr>, source.building <chr>,
## #   source.geometry <chr>, sport <chr>, stars <chr>, start_date <chr>,
## #   survey.date <chr>, tourism <chr>, url <chr>, ...
tm_shape(dresden) +
  tm_polygons()
## Linking to GEOS 3.8.0, GDAL 3.0.4, PROJ 6.3.1