If it is still operational, you can establish an AppleTalk/LocalTalk network (of which your 512K(e?) would be the only member). You will need to have the AppleShare extension in the System Folder. You will need a PhoneNet connector, a phone-jack-mounted terminating resistor, and a 4-conductor telephone lead-in cord. Your PhoneNet connector would be the older DB-9 version, I believe, not the later MiniDIN-8 version.
On a newer Mac running up to 10.3.9, you use the existing (or set up a new) Ethernet network, and turn on AppleTalk-over-Ethernet. You will need an Ethernet cable and a port on your Hub, Switch, or Router/Gateway, or exclusive use of the Ethernet jack on your later computer.
You need a protocol converter to connect the two networks. The two most available on the used market are the Farallon EtherMac iPrint LT, and the Asanté AsantéTalk. The Asanté product may still be available new for much more money. Almost all the references you will see are for connecting LocalTalk Printers. You can actually connect up to 8 LocalTalk devices, mixed older Macs and printers. I have bought the Farallon EtherMac iPrint LT with its power cube for well under $25.
This is an interesting reference document for OS 6, 7, 8, and 9:
Connecting LocalTalk to Ethernet networks
For Mac OS X 10.3, this article is very helpful:
OS 9 to Mac OS X 10.3 File Sharing
Really old mac to Mac OS X 10.4 is too much of a stretch. You can add third-party software (cheap, but not free) to OS 7.5.3 to connect them, but otherwise you need OS 9.