Hey there khushii94!
Let's help make sure you're able to connect to your Wi-Fi network as expected.
Have you tried restarting your Mac to see if that helps?
How to turn your Mac on or off
We know you mentioned that there are other devices able to connect just fine. To help isolate further, you can try deleting the network on your Mac and then restart both the Mac and network one after the other to see if that helps. Take a look at the articles listed below and keep us updated.
How to forget a Wi-Fi network on your iPhone, iPad, iPod touch, or Mac
If your Mac doesn't connect to the Internet over Wi-Fi
Recommended settings for Wi-Fi routers and access points
Regards.