Gamma-ray bursts (GRBs) are the most luminous events in the known universe. Due to their tremendous energy output, they serve as laboratories of physics far beyond anything that we can hope to achieve in terrestrial experiments. However, the insights we can gain from these violent phenomena depend on our understanding of the relevant physical processes at work. In this thesis, I study emission processes in GRBs. Specifically, I focus on GRBs as potential sources of ultra-high-energy cosmic rays (UHECRs) and investigate the cause of the early electromagnetic emission. UHECRs are extraterrestrial particles with incredible energies. Despite decades of research, the origin of UHECRs remains unknown. GRBs have long been one of the most promisin...