Mounting items on drywall doesn’t usually work well. Drywall is not made for carrying weight in that way, so unless it is a very small item you are mounting, you will need to use a wall anchor. Wall anchors come in many different styles and materials, but the principle is the same. They provide stability around the mounting point and they spread the weight out over a large area of the wall. Depending on the weight you are looking to support, you need to get a matching anchor. They will be listed by weight, and the safe bet is to go over the weight that you are expecting to have supported by it.
Basic wall anchors are just hammered into a hole, and some are screwed into the wall. There are some that require a bar that is inserted into the wall that will then rest against the wall from behind giving an even larger area of support for the weight.