Is this the correct way to use WaitForChild?

Keeping it simple and clear. Is this the correct way to use WaitForChild or no?

local object = game:WaitForChild(object)

if object then
    insert something here
end

If WaitForChild never finds the child, the calling thread will be yielded indefinitely, unless if a timeout if specified through the second parameter.
In this case, if you are yielding indefinitely, it would be useless to check if the object exists, because the WaitForChild ensures that (unless you specify a finite timeout).

Also, I wouldn’t typically be calling WaitForChild directly on the DataModel, as in normal circumstances, only services are parented to it. Services should be retrieved by calling GetService.

Alright thank you. I will remove the if statement from my code if it uses any from WaitForChild.

Would the case be the same for a timeout? Example: 3 Second Timeout

If the timeout runs out and the object isn’t there, the function returns nil. Check the docs.

So this is right to use if it has an timeout?

local object = game:WaitForChild(object, 3)

insert something here

Just to let you know I would always use :WaitForChild() in a LocalScript. :WaitForChild() is used in scenarios where you are not sure that the instance will be immediately there/loaded. But I always use :WaitForChild() on a LocalScript:

LocalScript

local workspaceService = game:GetService("Workspace")

local part = workspaceService:WaitForChild("Part") -- Path to your part name

part.Touched:Connect(function()
    print("Part was touched!")
end)