Some time ago I didn't have WLAN in my apartment but only ethernet cable plugged into my only computer. I had a Raspberry Pi 3B lying around so I started searching would it be possible to use it as a WLAN router. I found this github repo and following the instructions I was able to configure Raspberry so that I could plug the ethernet cable to Raspberry Pi and connect to WLAN emitted by it.
Now when I think this probably is not the safest solution (security wise) but soon I ended up buying a real router. Also I don't suggest using Raspberry Pi the way I do in the picture. Rather buy a real case to prevent unwanted shortages.
After I got a real router I changed my Raspberry Pi to LAN-wide adblocker.