Minecraft server, setting up network for a server problem

Hello! So, I want to set up a minecraft server on a pc. And always when I try to connect to that server it says connection timed out: no further information,
Thank You!
Could you provide more information please.
Is the server on localhost?
Are you on the same network as the server?