Although I am on my first MAC (M2 Air) going on a couple of weeks, I have been in IT on the PC side for decades and am an avid gamer that has been building rigs since DOS. When I have this issue in Windows first thing I do is see what IP address, DNS and gateway my computer has. In MAC: Apple Menu>System Settings>Wi FI. Right there it shows what WIFI SSID you are connected to... and to the right, click DETAILS. You see your IP and 'Router' (Gateway address) in the center area of the open window. Does this look correct, IP in correct network and the 'Router' is the IP of your router? More on that router IP in a moment, make not of it...
Along the left side, click DNS. It should list DNS server(s). Maybe that ROUTER IP, or if you set your router to hand out a public DNS (example, GOOGLE 8.8.8.8)... it should list _something_ . Make note of that.
Now, open TERMINAL. Apple menus, click GO>UTILITIES>TERMINAL. In the TERMINAL window that opens, type "ping {your router ip address you noted above}". Do you get replies " 64 bytes from 192.168...." or do you get "Request timeout for...". (Hit CTRL-Z) to stop the pings. Get replies? If you do, now ping "8.8.8.8". Replies? I'm guessing that if you can ping the router, you can most likely ping the internet IP too, because your other MAC does get internet and the issue is most likely NOT the router. Can't even ping the router? No network on that MAC and you can test PING on your working MAC to verify that your router CAN respond to ping.
Now if you could ping the router, and then 8.8.8.8 your issue is probably DNS as that is an internet address you were able to reach with the PING command. Test that by pinging google.com. If you could ping 8.8.8.8 but NOT google.com, issue is most likely DNS. Try pinging the DNS server address you noted above in the WIFI settings, if different from the ROUTER IP.
Yea a lot of steps when you consider your other MAC is working so we can assume your router is working and your wireless is working. But knowing if your MAC did get a valid IP address and DNS server address, and knowing if it can ping the router is important as the issue may be overall connectivity or a DNS issue.
The first thing I would do to try and fix it, is FORGET that network. Then reboot and reconnect to the wireless network. Then go back into SYSTEM SETTINGS/WIFI and look at the IP and DNS I am getting. Then try again to get to the internet. Try different browsers if you have Firefox or Chrome available.
Without knowing information like, if you have some kind of 'antivirus/antimalware' installed that might need an update to be compatible with Ventura (or be uninstalled/reinstalled), or if you are using a VPN and it needs an update... it can be hard to narrow down. So I always start with trying to figure out if it is an overall can't get to anything even the router, or a DNS issue, can't resolve names to IPs.