Ball at Rest Moved
Generally, when the ball is in play, if you accidentally cause your ball to move, lift it when not permitted or it moves after you have addressed it, add a penalty stroke and replace your ball. However, see the exceptions under Rule 18-2a. (Rule 18-2)
www.randa.org/en/Playing-Golf/Quick-Guide-to-the-Rules/Ball-Moved-Deflected-or-Stopped.aspx#ooid=FseDJqMjrQ7g96qIdNxuJ65HG4cTU5Bo
If someone else moves your ball at rest or it is moved by another ball, replace it without penalty to you.
Ball in Motion Deflected or Stopped (Rule 19)
If a ball struck by you is deflected or stopped by you, your partner, your caddie or your equipment, add a penalty stroke and the ball is played as it lies. (Rule 19-2)
If a ball struck by you is deflected or stopped by another ball at rest, there is no penalty and the ball is played as it lies, except in stroke play where you incur a two-stroke penalty if your ball and the other ball were on the putting green before you played. (Rule 19-5a)
randa.org