How to get order from transaction reference id

How to get order from transaction reference id.Please give code snippet.

can you describe the use case and why you need this lookup?