Distance is time multiplied by velocity, velocity is time multiplied by acceleration and acceleration is force divided by mass. So you can calculate it in your physics system like this:
acceleration = force / mass;
velocity += acceleration * deltaTime;
position += velocity * deltaTime;
force, acceleration, velocity and position are all two-dimensional vectors in this example: a data-structure with two fields: x and y. Basic math operations on vectors, like adding them or multiplying them by a single number, are not hard to implement. But it's usually easier and more reliable to just use a vector library for your programming language of choice.
Note that not all games simulate all of this. Some games don't bother simulating mass and force and just use constant acceleration. Some games don't even bother with simulating acceleration and just use constant velocity. Some games don't bother with velocity either and just teleport entities to where they are supposed to be. What level of simulation you need depends on the requirements of your game.
When you are following an ECS architecture, then you might want to split these three operations into three different systems
VelocitySystem which each one setting values in the components for the next one.
Gravity is a constant downwards acceleration. So when you have a
VelocitySystem, then you just need to create a
GravitySystem which adds a constant vector to the velocity (also multiplied by delta-time, of course). On the surface of the real planet Earth, the gravity vector's y-value is -9.81, but that value rarely feels right in games. Which is why most games change that value.
Friction is a force which acts in the opposite direction of the current velocity and increases with the velocity squared. You usually have a friction coefficient which is somewhere between 0 (no friction) and 1 (infinite friction). Unfortunately you can't just multiply the velocity with itself, because then a velocity vector with negative x or y turns positive. So you have to separate it into direction and magnitude, square the magnitude, and then turn it back.
frictionDirection = -normalizeVector(velocity)
frictionMagnitude = magnitudeVector(velocity) * magnitudeVector(velocity)
frictionVector = frictionDirection * frictionMagnitude;
velocity += frictionCoefficient * frictionVector * deltaTime;