If Julia is running code in a file, @__FILE__ should give you the full path to that file and @__DIR__ should equal dirname(@__FILE__). If you are running code directly in the REPL, @__DIR__ should give you the same result as pwd() and @__FILE__ will (*) give you a string indicating you are running from the REPL. If you are evaluating code in some IDE you need to consult its documentation to find out how it does that or at least tell us what environment you are working in.
(*) The docstring isn’t very clear on what @__FILE__ is expected to do from the REPL, what I wrote above is the observed behavior in Julia 1.6.