I have done this before, and I recommend a few things;
Your laptop/PC must be on the same WiFi as your 3DS. That means, your laptop/PC can't be on 5G WiFi since the 3DS can't connect to 5G, and only 2G.
Get a USB to Ethernet port for your laptop/PC, so that way, there's a stable connection...