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.

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.

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.

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.