All methods definitions for a specific function must be done in the same cell.
(Edit: now this is not always necessary, see further comments)
For now, those statements have to be wrapped in a begin...end block:
begin
import Distributions: rand
function rand()
end
end
https://github.com/fonsp/Pluto.jl/issues/7#issuecomment-878417670