How to Add Google Maps and OpenStreetMap Layers to QGIS
Add OpenStreetMap, satellite and Google basemaps to QGIS 3.40 LTR, 3.44 and 4.x as XYZ Tiles connections: the correct tile URLs, the OpenStreetMap tile usage policy, the licence-safe ways to get Google, Esri and Sentinel-2 imagery, and the same basemaps from PyQGIS, folium, leafmap and contextily.