Two-dimensional electron gas (2DEG) has been studied extensively because of its abundant physical properties, but no effort has been made to construct p-n or Schottky heterojunctions based on it. Here, we report a universal, practical Ar+-ion-bombardment assistant (AIBA) method to achieve a junction contact between a film of a p-type semiconductor (or metal) and 2DEG. Several materials have been attempted to verify the AIBA method, including a two-dimensional semiconductor (WSe2), an oxide superconductor (YBa2Cu3O7), an amorphous material (amorphous carbon) thin film, and a metal (Au). Despite different growth methods, all of the samples exhibit clear heterointerfaces and good rectifying behaviors, which indicates the formation of p-n and Schottky junctions. Different from the traditional methods to fabricate the vertical heterojunctions by layer-by-layer growth, the AIBA method enables us to achieve lateral heterojunctions, which may lead to remarkable physical properties. These as-fabricated heterostructures show significant photoconductivity at room temperature. This work paves the way for functional 2DEG-based devices with lateral heterojunctions.