Difference between 泊まる and 留まる


I'm just studying Japanese, and i know that 泊まる is like you Staying a night
like hotel / some place that temporary , but i just found 留まる is also meaning
stay/staying too in Basic Kanji book , but i don't know what does this word
specifically mean to and when to use both of this word.




Since 「泊まる」has already been answered I'll try explaining 「留まる」. 留まる describes
the position and movement of an object/person/anything, more specifically,
"staying in place"/motionless state of an object, which could potentially
move. e.g: Bird stopping on the tree, chemical molecule in space.




「泊まる」 should only be used to refer to,

  1. An animate living thing spending the night at a place
  2. A ship spending the night at a place

<https://www.weblio.jp/content/%E3%81%A8%E3%81%BE%E3%82%8B>

