How to make "Example Code"?

Nah:

-- This a single-line statement.
--[[
    Double quotes denote that this is a long string.
    Which means it can span as many lines as you want, lol.
    Hi.
    More lines.
]]

Replying to the OP, I think the best way is just to actually remember how they’re used. Methods’ names give you a clear description of what it does, in this case, :GetDescendants() means “Get all the descendants of the Instance that is calling this method on”.

If you really need an example code because we sometimes forget about stuff, you can comment out what methods do:

--[[
    :GetDescendants(): Returns an array containing all of the descendants of the instance.
    Code example:
        local descendants = workspace:GetDescendants()
        -- descendants is now an array, containing all descendants in workspace
        -- ...
]]
local whatever = workspace:GetDescendants()
-- ...

Or, you can always go to the Documentation website to look for a specific class or method to see what they do, instead of typing it in the editor.