I'll just highlight the relevant parts (and linux if needed):
You need to create this file by first finding the folder it goes in. It should be hidden in the appdata folder (or home folder on linux). For example at:
C:\Users\YOURUSERNAME\AppData\Roaming\Bitcoin
or on linux: ~/.Bitcoin/
Obviously replace YOURUSERNAME with whatever your computer user name is, the name you use when you log on to windows.
Then once you have found the folder for the particular coin you want to mine create a text file and name it bitcoin.conf or terracoin.conf or whatever coin your mining.
What to write in the text file is:
server=1
daemon=1
rpcuser=YOURMINERNAME
rpcpassword=YOURPASSWORD
rpcallowip=127.0.0.1
rpcport=18332
Bitcoin's port is 8332, some coins have a port they usually use. Though any random unused port can be used. So any random set of numbers that are free on local host.
Save the text file as whatever.conf
4. Start your miner
You will need to open your wallet first in server mode. To do this go to the folder where you start your wallet. Where the binary file is.
Windows: Then make a text file in that folder. Name it Server.bat. Change the text file to a .bat file. Then edit it in a text editor to say "bitcoin.exe -server" (replace with the name of whatever wallet exe you are trying to start). Save. Then run the .bat file and it should start the wallet.
Linux: run ./bitcoin-qt --daemon
Once the wallet is synced open your miner too. Type in your local host info and port. (Some miners do this on two lines, if port isn't asked for assume you need to do both on one line). Like this example for host:
127.0.0.1:18332
Hit enter, then type the user name you put in the .conf file
YOURUSERNAME
Hit enter, then type your password from the .conf file
YOURPASSWORD
Hit enter and you should start mining.