When I first started writing about the Mac, networking involved multiple protocols, cables, hubs, routers, switches and several crossed fingers as you attempted to configure the whole thing in the operating system.

Wi-Fi has done away with the cables and while there are still several protocols, if you want to connect Macs and Windows machines on a network, the only two you need to worry about are AFP and SMB, both of which have excellent support in OS X. Now, when you connect your Mac to a Wi-Fi network on which there are other Macs and PCs, by default you'll see them pop up in the Finder's sidebar.

There's still a great deal you can do, however, to configure settings and make sure everything runs as you want it to and, importantly, you only share files and folders you want to share. The magic all happens in the Network and Sharing panes of System Preferences.

The guidance here assumes that the computers you want to connect to and share with are connected to the same router, either wired or wireless, and have been allocated IP addresses. You can check this in the Network pane of System Preferences, in either the Ethernet, for wired, or Wireless tabs.

Read: How to fix a lost WiFi connection and get online: Fix your Mac WiFi issues

Connecting a Mac to a PC shared folder

Create a new account on your Mac for sharing

Before you start, it's worth noting that if you share an administrator account on a Mac, you'll allow access to everything accessible from that account. It's good practice to set up a specific account for sharing and thus limit access to only the file and folders you want to share.

To connect to a Windows PC from your Mac, you'll need the PC's network name and the name of the workgroup on which it sits. You can find those in the System Control Panel in Windows (press the Windows key and Pause together in Windows 7 or 8).

Add the name of the Windows workgroup the WINS tap underneath the Network section of System Preferences

Armed with those details, go to System Preferences > Network on your Mac, click on the network you're connected to (Wi-Fi or Ethernet) and click the Advanced button. Click the WINS tab on the next window and In the box next to NetBIOS Name, type a name that will identify your Mac on the PC network. Click the arrow next to the Workgroup box and select the workgroup name you collected earlier. If it's not there, type it into the text box. Click OK then Apply.

There are two options for connecting to the Windows PC. The simplest is to open a Finder window and check the sidebar to see if the PC is there. If it is, double-click it to connect. You should see a log in window. If the PC has guest access enabled, click the Guest button. If not, you'll need to type in the user name and password of a user account on the PC. When you've logged in successfully, you should see a window with a list of shared folders in it. Click on the one you want to connect to and click OK. It should now appear in the Finder's sidebar. And you can access shared files and folders on it. To disconnect, hover over it and click on the eject symbol.

Connecting to the remote server

If the PC doesn't show up in the Finder, click on the Go menu and select Connect to Server, or press Command-K in the Finder. Type 'smb://[pcname]' where '[pcname]' is the name of the PC you want to connect to. You should now see the log in window and you can proceed from there.

Read: How to make Macs welcome on a Windows network

Sharing files from your Mac over the Network

The first step in sharing files and folders on your Mac is to create a specific user account for the purpose. That way you can be absolutely sure you control what's being shared.

Go to the Users & Groups pane in System Preferences, click the padlock and enter the administrator username and password to allow you to make changes. Press the '+' button under the list of user accounts to create a new account. When the dialog box opens, select 'Sharing Only' from the menu next to New Account. Fill in the name details and give it a password. Click Create User.

Enable file sharing using SMB

Next, go to the Sharing pane in System Preferences and tick the box next to File Sharing. Click the Options button, check that 'Share files and folders using SMB' is ticked, and tick the box next to the account you just created. Make sure no other account is ticked.

Now, if you want to connect to your Mac from a Windows computer, you'll have to do it using that account. You won't be able to connect to any other account.

You can still, however, connect from another Mac to any account on that Mac. You can add any folder from the account you're currently logged into, and specify how users are able to access that folder.

Connecting to a Mac from a PC to copy files

Once you've set up file sharing on your Mac, go to the PC and open Explorer. Click on Network (if you're asked to enable Network Discovery, do it) and you should see your Mac in the window. Double-click the Mac's name and in the box that opens, type in the user name and password of the account you just created. You should now see the shared folders in Windows.

An alternative method is to click on the Start menu, then select Run and type in the name of the Mac or its IP address, then click OK.

You can now copy files to and from the shared folders on the Mac.

Networking Problems?

If you can't connect from the PC to your Mac, try resetting the password in Users & Groups in System Preferences and logging in again from the PC with the new password. If that doesn't work, head to the Security & Privacy pane in System Preferences, click the Firewall tab, then press Firewall Options and make sure File Sharing (AFP, SMB) is set to 'Allow incoming connections.'

Read: Mac Terminal Tutorial: 10 fun things on the Mac using Terminal