Welcome to the forums.
Do you have a WD TV Live or just a WD TV? Because the Live (or Plus) is the only one you can hook up to the internet).
Assuming you have a Live, you first need a wireless adapter that is on the approved list (ones that are known to work with the Live). You can find that list here:
Note that it’s important to get the right revision number as the Live does not support all versions of the adapters. Your best bet is to buy it from a local store where you can return or exchange it if it doesn’t work.
Then, of course, you need a wireless router that the adapter can connect with (but I assume you already have that).
If you have the right USB adapter and still can’t get it working post back here and we’ll see if we can help you through the next steps.