ElGamal cipher decryption (reposted not from guest account)
You need to further specify your question. The Diffie-Hellmann Key Exchange Protocol is used to establish a secret key over a public channel. After the protocol run, both Alice and Bob have the same key $k_{ab}=A^b=B^a=g^{ab}$.

The El-Gamal system is based on asymmetric cryptography and therefore public keys and secret keys are required. Since the El-Gamal ciphertext consists of two parts $c=(c_1,c_2)$ your description of the decryption function seems to be mixed up. Have a look at the decryption formula of El-Gamal and try to calculate it step by step to understand how the cipher works.