What exactly do you mean?
If you have an object moving, and you want gravity to account for its movement, then
you can just do this :
const float GRAVITY = -9.8;
ball.x += ball.velocity.x * dt;
ball.y += ball.velocity.y + GRAVITY * dt;
Those follow from basic Newtonian equation.