Rule 15 · Relief without penalty
Rule 15: Leaves, stones, rake, another ball
Official title: Relief from Loose Impediments and Movable Obstructions (Including Ball or Ball-Marker Helping or Interfering with Play)
Whatever is lying around loose is not part of the challenge. You may remove leaves, stones, rakes and bottles without penalty. You only have to take care if your ball moves as you do.
15.1 Leaves, stones and other natural objects
Since 2019 you may remove loose impediments everywhere, including bunkers and penalty areas. If your ball moves as you do so, you replace it and get one penalty stroke. On the putting green and the teeing area there is no penalty.
Rules questions on this
15.2 Rakes, bottles and other artificial objects
You may remove movable obstructions everywhere. If your ball moves as you do so, you replace it without penalty. If it lies on the obstruction, you lift it, remove the obstruction and drop within one club-length of the spot right underneath. On the putting green you place it.
15.3 A ball helping or interfering
If a ball on the putting green could help another player, its owner may lift it, and anyone may require that. In stroke play the owner may play first instead. If you agree there to leave it as a help, everyone involved gets the general penalty. If another ball interferes with you anywhere on the course, you may have it lifted.
Our own simplified summary of the 2023 Rules of Golf. The official Rules text is what counts.