Guanine is one of the four main nucleobases found in the nucleic acids DNA and RNA, playing a critical role in encoding genetic information. It pairs with cytosine through three hydrogen bonds, contributing to the stability of the DNA double helix structure.