You can use a combination of list methods.

//start context
list<string> lst= new list<string>{'aa','bb','cc','dd'};
string var = 'cc';

//find the index of var
integer index; 
for(integer i =0;i< lst.size();i++){
 if(var==lst[i]) index=i;
}
//may want to throw an exception if index is still null

list<string> tempLst = lst.clone();//backup your collection
lst.clear(); //empty your collection

lst.add(tempLst[index]); //retrieve your desired record and put it on index 0
tempLst.remove(index); //remove your record from the old collection
lst.addAll(tempLst); //add the other data to your list 

system.debug(lst); /// |USER_DEBUG|[22]|DEBUG|(cc, aa, bb, dd)

But, logic like this might imply you should consider exploring the apex map collection type and its methods. Know you can use the map.values() property to still reference it as a list, or can directly iterate over a map in Visualforce too.

Answer from Samuel De Rycke on Stack Exchange
🌐
Salesforce Developers
developer.salesforce.com › docs › atlas.en-us.apexcode.meta › apexcode › langCon_apex_collections_lists.htm
Lists | Apex Developer Guide | Salesforce Developers
A list is an ordered collection of elements that are distinguished by their indices. List elements can be of any data type—primitive types, collections, sObjects, user-defined types, and built-in Apex types.
🌐
S2 Labs
s2-labs.com › home › lists in apex
Lists in Apex | Salesforce Developer Tutorials
August 6, 2025 - Define a List: Start by defining a list. In Apex, lists are dynamic arrays that can hold collections of objects.
Rating: 4.7 ​ - ​ 874 votes
🌐
S2 Labs
s2-labs.com › home › lists initialization in apex
Lists Initialization in APEX | Salesforce Developer Tutorials
August 6, 2025 - The syntax for initializing a list in Apex involves specifying the type of the list and creating a new instance of it.
Rating: 4.6 ​ - ​ 675 votes
🌐
Code With Sally
codewithsally.com › home › blog archive › beginner’s guide to salesforce apex: an introduction to collections – lists, sets, and maps
Beginner’s Guide to Salesforce Apex: An Introduction to Collections - Lists, Sets, and Maps
March 20, 2024 - An Apex List is a collection of multiple items, much like a to-do list where you can add new tasks, remove completed ones, and prioritize the order in which you want to complete them.
🌐
Sfdcmeet
sfdcmeet.com › development › apex-in-salesforce › list-in-apex-collections
List in Apex Collections – Salesforce CRM Online Training and Knowledge Sharing
Hence, List in Apex Collections can be defined as a collection of ordered elements since it is accessed by index and maintains the order of insertion. Also it would accepts duplicates. We have other types of collections as well.
🌐
TutorialsPoint
tutorialspoint.com › apex › apex_collections.htm
Apex - Collections
List can contain any number of records of primitive, collections, sObjects, user defined and built in Apex type. This is one of the most important type of collection and also, it has some system methods which have been tailored specifically to use with List. List index always starts with 0.
Find elsewhere
🌐
Decodeforce
decodeforce.com › blogs › apex-list-methods-and-examples
Salesforce apex list class and methods with practice examples
List is one of the collections in apex. A list is an ordered collection of elements, where each element can be accessed by its index.
🌐
Nebula Consulting
nebulaconsulting.co.uk › home › insights › list processing in apex with map(), filter(), and more
List Processing in Apex with map(), filter(), and more
September 1, 2025 - Bringing filter() and map() to Apex saves us from the boilerplate, and highlights the important stuff. The building block for this technique is the Lazy Iterator class mentioned in a previous post. This class supports filter(), map(), and more. It also does this in an efficient way, so that there are no intermediate lists created while you do your processing.
🌐
Salesforce
trailhead.salesforce.com › learn › apex basics for admins › use collections
Understanding Apex List Collections and Usage - Trailhead
Explain two ways to add items to a list. Did you know you can learn from an expert? Watch this video to find out more about the topics in this module: A collection is a type of variable that can store multiple items. In our tea example, we have a sugar bowl with several sugar cubes inside it. The sugar bowl is considered a collection and the sugar cubes are items that are stored in that collection. Although there are three types of Apex collections (lists, sets, and maps), in this module we focus on lists.
🌐
CRS Info Solutions
crsinfosolutions.com › home › list class in salesforce apex
List Class in Salesforce Apex
Salesforce Training
In Apex, the List class is a collection type that represents a dynamically-sized array. It is part of the Salesforce Apex Collection framework and provides methods to manipulate lists of objects I have enrolled for Salesforce Admin and development online course at CRS info solutions. It’s really the best training i have ever taken and syllabus is highly professional
Rating: 5 ​
🌐
JanbaskTraining
janbasktraining.com › home › how to create list in salesforce and set methods: to ensure a bright career
How to Create List in Salesforce and Set Methods: To Ensure A Bright Career
April 2, 2024 - A Set in Salesforce is an unordered ... user-defined types, and built-in Apex types. An Aapex List is a collection of ordered elements that can be located based on an index....
🌐
SFDC Stop
sfdcstop.com › 2021 › 09 › list-data-structure-in-apex-apex-data.html
List Data Structure in Apex | Apex Data Structure Tutorials by SFDC Stop - SFDC Stop
September 10, 2021 - In this post, we're going to learn about how we can use list data structure in apex. A list is a collection of elements or records that you want to store. List in apex can store elements of any data type.
🌐
Oracle
blogs.oracle.com › apex › beginners-guide-to-list-of-values-in-oracle-apex
Beginners Guide to List of Values in Oracle APEX | apex
June 12, 2025 - This first in a series of blog posts on List of Values examines the different ways you can allow end users to select data from a list of allowed values. Starting with a text column that allows free-form data entry, you will learn different ways to limit what your end users can enter.
🌐
SFDC Kid
sfdckid.com › 2019 › 04 › salesforce-apex-collection-list.html
APEX COLLECTION : List - SFDC Kid
Then in the second list, we add str in second list findlist. Then by using get(1) method, it will get value inside 1 and store inside x and return finally x i.e. Ravi. That's it !! In this way, you can use the apex collection List.
🌐
Oracle
apex.oracle.com › pls › apex › r › apex_pm › ut13 › lists
Lists - Universal Theme
Lists are a very versatile component within APEX and can be used as the foundation for any number of UI components. This page introduces you to the two List Templates which are especially useful for navigation · This list template is useful for displaying badges or counters
🌐
SaaS Guru
saasguru.co › salesforce-apex-list-class
Apex List Class: Enhance Salesforce Development with Key Practices – saasguru
January 28, 2024 - In Apex, the programming language used for Salesforce development, a List is a collection class designed to store elements in a specific order. Its ability to hold duplicate values and dynamic size characterizes it, meaning elements can be added or removed at runtime.
🌐
C# Corner
c-sharpcorner.com › article › apex-list-in-salesforce
Apex List In SalesForce
September 11, 2019 - A list is like an array, a sequential collection of elements with first index position as zero. List can contain elements of primitive types, sObjects, user-defined objects, Apex objects or even other collections.