As long as the resource (assuming stragtegic or luxury resource here) is withing you cultural borders and is connected to your cities with roads, you automatically have access to it.
If it's outside your cultural boundaries, you'll need to build a colony on it, or a city next to it (and still connect that colony/city to your main road network). Keep in mind that colonies disappear when they fall in someone else's boundaries (which also happens when someone else builds a city next to it). So if you desperately need that resource (and want to deny other civs that resource) and it's not within your borders you should seriously consider building a city on/next to it. Even if that city will have problems to grow.