My laptop cannot detect wifi signals from wifi modems and routers. However, it can detect and connect to my phone's hotspot. I tried many things I found on the internet but they didn't work. Even tried Windows system restore and HP system recovery. After both of them, during the start up, wifi hotspots appeared for a few seconds and got lost again. So I think this means nothing is wrong with the hardware here as HP diagnostics tells the same. Sadly, othing previously posted on this forum helped me.
I tried the all first 5 steps and some of the parts of the 6th step at this link (so please don't suggest me apply all the step 6):
Be alert for scammers posting fake support phone numbers and/or email addresses on the community. If you think you have received a fake HP Support message, please report it to us by clicking on "Flag Post".