Hey there and welcome to the Samsung UK and EU Community Customer to Customer Forum
Sorry to hear you're having issues with WiFi.
We have had a few intermittent (sorry for the pun) posts on here about this issue on some devices so please do a search to see what happened and their outcomes.
For now, I would perform a Reset Network Settings on your device (you won't lose data but you will need to input your WiFi passwords again, your mobile network will send APNs through almost immediately, you probably won't even notice).
Hope that fixes your issue.
S24 Ultra