You will know with absolute certainty that the request came from the Lord.
HOWEVER, whether the person recognizes at the moment or only in hindsight that it was required for them to develop the faith necessary for redemption is not universal. Some know at the time, some only know in hindsight. What is absolutely universal is that when the test has been passed, the faith exists. When it does, it will be enough for redemption and the promise of eternal life.
Joseph knew he had the promise of eternal life (as recorded in D&C 132: 49) before he went to Carthage to die. He knew he was going to die. Death was not his great challenge, but the physical ratification of the faith which already existed in him. The earlier trials had been enough to prove him and put that power within him. His death was an extension of existing faith and knowledge.
The order of things is established and can be known. The details of how it unfolds in individual lives will be specific to the individual. Whether the person realizes the final great test is underway or not will depend on the person. I did not. I only came to realize in hindsight what was underway.