A method performed by a terminal in a wireless communication system using beamforming, comprising: receiving, from a base station, configuration information on a contention-based random access, RA, and information on a threshold for a selection of a synchronization signal, SS, block; receiving, from the base station, configuration information on a contention-free RA and information on at least one RA preamble associated with each SS block; in case that the configuration information on the contention-free RA comprises information on contention-free RA resources associated with SS blocks and at least one SS block with a signal quality greater than the threshold among the SS blocks associated with the contention-free RA resources is available, selecting a first SS block from among the at least one SS block associated with the contention-free RA resources; and selecting a first RA preamble corresponding to the selected first SS block based on the information on the at least one RA preamble associated with each SS block; in case that at least one SS block with the signal quality greater than the threshold among the SS blocks associated with the contention free RA resources is not available, identifying that at least one SS block with a signal quality greater than the threshold among SS blocks associated with contention-based RA resources; selecting a second SS block from among the at least one SS block associated with the contention-based RA resources; and selecting a second RA preamble randomly with equal probability from at least one contention-based RA preamble associated with the selected second SS block; selecting (1403, 1405) a physical random access channel, PRACH, occasion based on the selected first SS block or the selected second SS block; and transmitting, to the base station, the first RA preamble or the second RA preamble in the selected PRACH occasion. receiving, from a base station, configuration information on a contention-based random access, RA, and information on a threshold for a selection of a synchronization signal, SS, block; receiving, from the base station, configuration information on a contention-free RA and information on at least one RA preamble associated with each SS block; in case that the configuration information on the contention-free RA comprises information on contention-free RA resources associated with SS blocks and at least one SS block with a signal quality greater than the threshold among the SS blocks associated with the contention-free RA resources is available, selecting a first SS block from among the at least one SS block associated with the contention-free RA resources; and selecting a first RA preamble corresponding to the selected first SS block based on the information on the at least one RA preamble associated with each SS block; selecting a first SS block from among the at least one SS block associated with the contention-free RA resources; and selecting a first RA preamble corresponding to the selected first SS block based on the information on the at least one RA preamble associated with each SS block; in case that at least one SS block with the signal quality greater than the threshold among the SS blocks associated with the contention free RA resources is not available, identifying that at least one SS block with a signal quality greater than the threshold among SS blocks associated with contention-based RA resources; selecting a second SS block from among the at least one SS block associated with the contention-based RA resources; and selecting a second RA preamble randomly with equal probability from at least one contention-based RA preamble associated with the selected second SS block; identifying that at least one SS block with a signal quality greater than the threshold among SS blocks associated with contention-based RA resources; selecting a second SS block from among the at least one SS block associated with the contention-based RA resources; and selecting a second RA preamble randomly with equal probability from at least one contention-based RA preamble associated with the selected second SS block; selecting (1403, 1405) a physical random access channel, PRACH, occasion based on the selected first SS block or the selected second SS block; and transmitting, to the base station, the first RA preamble or the second RA preamble in the selected PRACH occasion.