The relationship between these two kinds of costs is that the change in variable costs creates the change in marginal costs. Therefore, the slope of the total variable cost curve is the marginal cost of the product. Let us see why this is so.
First, remember that variable costs are the costs that change as output changes. We can distinguish these from fixed costs, which do not change when you make more or less of a product. Imagine that you are running a motel. You have already built the motel and the cost of the building is your fixed cost. That cost remains the same whether you rent out all the rooms or none of the rooms. However, you also have variable costs. If you rent out more rooms, you have to pay more for housekeeping staff. You have to pay for the internet that the guests use. You have to pay for the water and the detergent used to wash the bedding after they leave. You have to pay for the food for the continental breakfast that you provide. All of these costs change as you rent more or fewer rooms.
Now let us think about what marginal costs are. The marginal cost of renting out a room is the amount that your total costs rise when you rent out that room. If you think about it, you will see that this cost has to be made up of variable costs. When you go to rent out that room, your fixed costs do not change. If the cost of renting (for example) 51 rooms is greater than the cost of renting (for example) 50 rooms, those costs have to be variable costs. They come from the housekeeping, the water and detergent, the internet, and the breakfast.
Because of this, your variable costs and your marginal costs have to be the same thing. If all your costs are fixed, you will have no marginal costs. The change in your total variable costs is the same thing as your marginal cost.