Rename the source file to .lpr, choose "open project" in the menu, and when the IDE asks if you want to create a project, say yes and choose "simple project".
The review {$mode fpc/delphi/objfpc} directives to force the source in the correct mode. The default mode of fpc is {$mode fpc} but Lazarus new source is usually {$mode objfpc}