Twilio evangelist here.
How you do this depends on whether or not you are responding to an inbound text message or initiating a new message to send to a user.
If its the former, you can use TwiML to tell Twilio how to respond to the inbound message. IN your case that TwiML would look like this:
<Response>
<Message>Hey this is your access code [YOUR_RANDOM_NUMBER]</Message>
</Response>
If its the latter, you can use the Twilio C# helper library to send the message:
// instantiate a new Twilio Rest Client
var client = new TwilioRestClient(AccountSid, AuthToken);
client.SendMessage(
"YYY-YYY-YYYY", // From number, must be an SMS-enabled Twilio number
person.Key, // To number, if using Sandbox see note above
string.Format("Hey this is your access code {0}","[YOUR_RANDOM_NUMBER]")
);
I'd suggest checking out our Quickstarts which will walk you through the basics of sending and receiving SMS messsages and making and receiving phone calls using C#:
https://www.twilio.com/docs/quickstart/csharp/sms/hello-monkey
Hope that helps.