There's
this repo and
this blog post you can use as examples but if you have any specific question about those, let us know.
Normally, if you install your custom package in your environment you can import and call it pretty much anywhere (Prefect task, flow or a normal script/function).