Losing your ball in golf can have different consequences depending on the event. Most commonly, the golfer will take a one stroke penalty and have to go back to where they last hit their ball. A golf course has tons of hazards such as trees, high grass, and more. This means that it is not uncommon for golfers to lose their ball.
If they lose their ball, a golfer and their caddie will have five minutes to search for the ball. If the ball is not found in 5 minutes, then it is deemed lost. Normally, when a ball is lost, golfers typically make the mistake of taking a drop right in the area of where they lost it. This is actually not what you are supposed to do, and you actually need to go back to the spot where the ball was last played and hit from there. You take a one stroke penalty, go back to where you last played, and then hit from there.
What is great about golf is that you can play it whenever you want with your friends, and you can pretty much make your own rules. If someone is simply playing with their friends, they can have more than 5 minutes to look for the ball (if they feel like taking the time). The group can also decide whether the golfer can drop wherever they want, or if they should go back to the spot it was last played. Oftentimes, other golfers will allow them to drop it near where they lost it to speed up the pace of play.