Connection refused

when I try to type ssh to connect to the raspberry pi machine I get connection refused it is on port 22. this is on a macbook pro. i can ping the ip address. it is connected because when i disconnect the eithernet cable it gets disconected. could it be a security issue or the wrong port I am confused. please help. I heard on one of the other responses for this that it was suposed to be on port 23. could that be the problem if there is any more information needed please let me know.
ps below are the messages

64 bytes from icmp_seq=14 ttl=255 time=0.086 ms
64 bytes from icmp_seq=15 ttl=255 time=0.080 ms
64 bytes from icmp_seq=16 ttl=255 time=0.084 ms
— ping statistics —
17 packets transmitted, 17 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.067/0.079/0.086/0.005 ms
Davids-MacBook-Pro:~ davidlorfel$ ssh
ssh: connect to host port 22: Connection refused
Davids-MacBook-Pro:~ davidlorfel$

I think the issue is you need to use
ssh pi@

You should check your IP address on the pi. No remote login or ping, on it. To do that type hostname -I into the terminal. Your router once in a while changes IP addresses of computers. If its the your address changed you should look into creating a static IP adress.