How do I get the velocity of a non rigidbody

I looked all over the internet and I only see this answer in JavaScript badly. I did this a wile back it did it by subtracting its position every second or something but I cant find it out.

You could record the transform.position at one point of time, then a little later (like 1 second or shorter?) record it again, then get the distance between both Vector3s and use this number as the speed (= the distance the objects travelled in the last second).