GeoJSON is a popular file format to store the coordinates and properties of a map.
With QGIS you can create GeoJSON files from Shapefiles (in this tutorial QGIS 3.8 is used).
First add your Shapefile layer to the project in main menu => Layer => Add layer => Add vector layer. Make sure to specify the Coordinate Reference System (CRS) of the Shapefile while adding the shape.
Now you can export the shapefile to GeoJSON in the menu (right click on the layer and choose Export => Save Features As…)In the next screen make sure to choose the right CRS: EPSG:4326 – WGS 84. This CRS works also if you want to project your map in EPSG:3857 – WGS 84 / Pseudo-mercator.
Now you have a GeoJSON file to use in Google Maps or OpenStreetMap.
Check this question on Stackexchange to read more about the difference between EPSG 3857 and 4326 for GoogleMaps, OpenStreetMap and Leaflet.