How to compute the forward price using a replicating portfolio?

I post this question here as I didn't receive an answer in the Mathematics community.

I am trying to understand how replicating portfolios can help us determine fair prices.