@CZXPEK basically explained it perfectly. FindFirstChild attempts to find the instance it searches for; if it cannot find any, it returns nil. Usually, attempting to use the returned nil (outside of conditioning) will give an error. Directly accessing will give an error.
You can also use WaitForChild to wait for the instance to load. If the instance doesn’t ever show up, the code will just yield.
No, absolutely not! Both work the same way, but I would still recommend using :WaitForChild() instead because:
:FindFirstChild() sometimes has performance issues.
If you directly access the child, it could error saying that the object has not been found (the game hasn’t fully loaded yet so that specific object doesn’t exist yet).
I would use :FindFirstChild() to check if a specific object exists. Here is an example of how you check if an object exists using :FindFirstChild()
local remoteEvent = ReplicatedStorage:FindFirstChild("RemoteEvent")
if remoteEvent then -- if the child "RemoteEvent" has been found in the ReplicatedStorage then
remoteEvent:Remove() -- example: remove the "RemoteEvent"
end