Zoom and orbiting sometimes acts weird

I was just doing a project and I then
noticed that if I zoomed it zoom to the cursor and not the object I’m looking at.
if I orbit I lose the object out of my view,
also zooming.
It’s like zooming to a object thats not there
sometimes it does it sometimes it does not. it’s very annoying…

Select your object and then hit the numpad key " . " (dot on the numeric keyboard)