How can I get pawn or controller?

I am very starter.
My question is
what is difference between

APlayerController* PC = Cast<APlayerController>(GetController());


APlayerController* PC = UGameplayStatics::GetPlayerController(this, 0);

At first I used Cast one to get exact cursor location and size of screen view.
But it failed and return nullptr again and again.
So I googled for solution and found out second one.

But that line only worked in Tick function, or cause UE Crash Report.
I need to get PC only once. what should i do?

And now, i have another situation that i need to get class by

ACustomCharacter* CR = Cast<ACustomCharacter>(GetCharacter());

(I’ve tried GetPawn GetActor too)
But it returns nullptr.

What is correct way to get controller of character?
is there any strict rule about Cast of GetCharacter?
is there any way to prevent or notice Crash before build?

Is there any answer I will be very Thankful.
Sorry for broken English.