A firm's production function is a relationship between inputs and outputs (thus what are the combinations of input and out that can be obtained given the available technology). y-axis is Output and x-axis is for inputs.
A firm's cost function is a relationship between costs (expressed in monetary terms) and output. Thus, for every level of output, and market prices for inputs, what is the cheapest way to produce it. Output on the x-axis and Cost (monetary units) on the y-axis.
This relationship isn't as straight forward if prices aren't linear. However, most models will assume linear prices. If that is the case, you can kind of see the cost function as the inverse of the production function (essentially flipping the axes), because more inputs for an unit of output imply more costs.
As far as actually getting the cost function from the production function, you have to start by finding the argmin for this cost minimization problem:
$$\min (w \cdot k + r \cdot k)$$
So wages will be equal to marginal productivity of Labor and interest rate will be equal to marginal productivity of capital in equilibrium.
Let me know if you don't know how to keep going from here.