it never works because 'operation times out'
There are only two or three ways for this to happen:
The Pi is running a firewall which intentionally drops packets. This is unusual and would not happen by accident, so unless you've set it up that way, this is not the cause. It's also possible some other firewall between the Pi and your computer is doing it, but that too is unlikely: Firewalls do not normally drop packets, they reject them, meaning you get a response right away telling you you cannot connect. However, they can drop them if they are intentionally configured to do so, so this is still a possibility, just an unlikely one.
The IP address is incorrect or otherwise not usable to reach the pi from where you are.
You have incredibly bad network latency.
Realistically, you can cross #3 off the list. Presuming #1 is also out of the picture, that just leaves #2. This could also be called a routing problem and the general point is the request is not reaching the Raspberry Pi for some reason; this could be because the Pi is misconfigured or because it is not connected to the same network. It is possible for the pi to be connected to the outside world via your LAN but not correctly routed to from inside. You should try looking for it with a port scanner, packet sniffer, or ping request. I believe by default it responds to pings if it receives them, and a port scanner will tell you if port 22, the SSH port, is open.
There are no other possibilities. That is the nature of IP based networking.
Port scanners (there are many, you can get easy-to-use smart phone apps as well, just search for "port scanner") will usually look up MAC address OIDs; the Raspberry Pi Foundation have one (B8:27:EB) which is used with all onboard NICs, so if it is connected via ethernet (or a Pi 3's built-in wifi), the scanner should identify it clearly as a "Raspberry Pi Foundation" device, and/or the first three parts of the MAC address should be
Of course, if you are using a USB wifi adapter, that won't be the case. However, you can easily get the MAC address of the adapter either directly on the pi (look at
sudo ip link output) or by sticking it in another computer. If you then cannot find the IP address with a port scanner showing that MAC address, then this is conclusive proof of the routing problem. If you can but other applications still time out, this may be indicative of the ARP problem mentioned below.
There isn't enough information in your question to suggest much about how to solve it, but if I had to guess, I'd say it is either:
Because the Pi is connected via ethernet and you are using wifi on your laptop, and while the Pi is being allowed to establish connections to the outside world and have replies routed back to it, ARP exchanges on the LAN aren't being routed properly, so the laptop can't connect to the Pi.
Because you are connecting the Pi directly to the laptop with an ethernet cable and are confused about the actual IP address used in that scenario.